Skip to content

Commit

Permalink
3.6 (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored Jan 5, 2021
1 parent eaf0a0d commit 32f9c61
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 21 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.6.0](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/compare/3.5.0...3.6.0) - 2021-01-04
### Added
- [[#486](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/486)] Added `DataSource` to provide a `DataSourceInterface` implementation. ([@franmomu](https://github.com/franmomu))

### Deprecated
- [[#492](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/492)] Deprecated `ModelManager::getMetadata()` method. ([@franmomu](https://github.com/franmomu))
- [[#492](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/492)] Deprecated `ModelManager::hasMetadata()` method. ([@franmomu](https://github.com/franmomu))
- [[#486](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/486)] Deprecated `ModelManager::getDataSourceIterator()`. ([@franmomu](https://github.com/franmomu))
- [[#473](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/473)] Deprecated `ModelManager::getModelIdentifier()`. ([@franmomu](https://github.com/franmomu))
- [[#473](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/473)] Deprecated `ModelManager::getDefaultSortValues()`. ([@franmomu](https://github.com/franmomu))
- [[#473](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/473)] Deprecated `ModelManager::getDefaultPerPageOptions()`. ([@franmomu](https://github.com/franmomu))
- [[#473](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/473)] Deprecated `ModelManager::modelTransform()`. ([@franmomu](https://github.com/franmomu))
- [[#451](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/451)] Deprecated passing `null` as argument 2 for `ModelManager::find()`; ([@franmomu](https://github.com/franmomu))
- [[#451](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/451)] Deprecated passing `null` as argument 1 for `ModelManager::getNormalizedIdentifier()`; ([@franmomu](https://github.com/franmomu))
- [[#451](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/451)] Deprecated passing other type than `object` as argument 1 for `ModelManager::getUrlSafeIdentifier()`; ([@franmomu](https://github.com/franmomu))

### Fixed
- [[#497](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/497)] Fixed calling to deprecated `Pager::setCountColumn()` method. ([@franmomu](https://github.com/franmomu))
- [[#479](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/479)] Fixed calling to `AdminInterface::id` without an object. ([@franmomu](https://github.com/franmomu))
- [[#463](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/463)] `FormContractor::getDefaultOptions()` passes `collection_by_reference` option instead of `by_reference` to `AdminType` in order to respect the new API ([@VincentLanglet](https://github.com/VincentLanglet))
- [[#470](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/470)] Fixed returning an array of identifiers in `ModelManager::getIdentifierFieldNames`. ([@franmomu](https://github.com/franmomu))
- [[#468](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/468)] Fixed the return type of `TypeGuesser::guessType`, it must return `null` or `TypeGuess`. ([@franmomu](https://github.com/franmomu))
- [[#459](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/459)] Fixed deprecation constructing `FieldDescription` without arguments. ([@franmomu](https://github.com/franmomu))

## [3.5.0](sonata-project/SonataDoctrineMongoDBAdminBundle/compare/3.4.0...3.5.0) - 2020-10-09
### Added
- [[#438](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/438)] `FormContractor::getDefaultOptions()` pass `by_reference` from `CollectionType` to `AdminType` ([@VincentLanglet](https://github.com/VincentLanglet))
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-3.x.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
UPGRADE 3.x
===========

UPGRADE FROM 3.x to 3.x
UPGRADE FROM 3.5 to 3.6
=======================

### Sonata\DoctrineMongoDBAdminBundle\Guesser\TypeGuesser
Expand Down
32 changes: 16 additions & 16 deletions src/Model/ModelManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(ManagerRegistry $registry, ?PropertyAccessorInterfac
/**
* NEXT_MAJOR: Change visibility to private.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be private in version 4.0
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be private in version 4.0
*
* @param string $class
*
Expand All @@ -83,7 +83,7 @@ public function getMetadata($class)
// Remove this block.
if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) {
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and'
'The "%s()" method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and'
.' will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
Expand Down Expand Up @@ -129,15 +129,15 @@ public function getParentMetadataForProperty($baseClass, $propertyFullName)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0
*
* @return bool
*/
public function hasMetadata($class)
{
if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) {
@trigger_error(sprintf(
'The "%s()" method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and'
'The "%s()" method is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and'
.' will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);
Expand Down Expand Up @@ -206,7 +206,7 @@ public function find($class, $id)
if (null === $id) {
@trigger_error(sprintf(
'Passing null as argument 1 for %s() is deprecated since'
.' sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.',
.' sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand Down Expand Up @@ -330,14 +330,14 @@ public function executeQuery($query)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.
*
* @psalm-suppress NullableReturnStatement
*/
public function getModelIdentifier($class)
{
@trigger_error(sprintf(
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.',
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand All @@ -361,7 +361,7 @@ public function getNormalizedIdentifier($document)
if (null === $document) {
@trigger_error(sprintf(
'Passing null as argument 1 for %s() is deprecated since'
.' sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.',
.' sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand All @@ -388,7 +388,7 @@ public function getUrlSafeIdentifier($document)
if (!\is_object($document)) {
@trigger_error(sprintf(
'Passing other type than object for argument 1 for %s() is deprecated since'
.' sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.',
.' sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand Down Expand Up @@ -434,7 +434,7 @@ public function batchDelete($class, ProxyQueryInterface $query)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.
*/
public function getDataSourceIterator(DatagridInterface $datagrid, array $fields, $firstResult = null, $maxResult = null)
{
Expand Down Expand Up @@ -528,12 +528,12 @@ public function getPaginationParameters(DatagridInterface $datagrid, $page)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.
*/
public function getDefaultSortValues($class)
{
@trigger_error(sprintf(
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.',
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand All @@ -548,12 +548,12 @@ public function getDefaultSortValues($class)
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.
*/
public function getDefaultPerPageOptions(string $class): array
{
@trigger_error(sprintf(
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.',
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand All @@ -563,12 +563,12 @@ public function getDefaultPerPageOptions(string $class): array
/**
* NEXT_MAJOR: Remove this method.
*
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.
* @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.
*/
public function modelTransform($class, $instance)
{
@trigger_error(sprintf(
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.',
'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.',
__METHOD__
), E_USER_DEPRECATED);

Expand Down
8 changes: 4 additions & 4 deletions tests/Model/ModelManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function testGetNormalizedIdentifierNull(): void
$manager = new ModelManager($this->registry, $this->propertyAccessor);

$this->expectDeprecation(
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getNormalizedIdentifier() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.'
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getNormalizedIdentifier() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.'
);

$this->assertNull($manager->getNormalizedIdentifier(null));
Expand Down Expand Up @@ -318,7 +318,7 @@ public function testModelTransform(): void
$instance = new \stdClass();

$this->expectDeprecation(sprintf(
'Method %s::modelTransform() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.',
'Method %s::modelTransform() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be removed in version 4.0.',
ModelManager::class
));

Expand Down Expand Up @@ -380,7 +380,7 @@ public function testFindBadId(): void
$model = new ModelManager($this->registry, $this->propertyAccessor);

$this->expectDeprecation(
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::find() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.'
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::find() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.'
);

$this->assertNull($model->find('notImportant', null));
Expand All @@ -405,7 +405,7 @@ public function testGetUrlSafeIdentifierNull(): void
$model = new ModelManager($this->registry, $this->propertyAccessor);

$this->expectDeprecation(
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getNormalizedIdentifier() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be not allowed in version 4.0.'
'Passing null as argument 1 for Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getNormalizedIdentifier() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.6 and will be not allowed in version 4.0.'
);

$this->assertNull($model->getNormalizedIdentifier(null));
Expand Down

0 comments on commit 32f9c61

Please sign in to comment.