diff --git a/CHANGELOG.md b/CHANGELOG.md index e8774c4b36..d4e8813028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,26 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.86.0](https://github.com/sonata-project/SonataAdminBundle/compare/3.85.0...3.86.0) - 2021-01-09 +### Added +- [[#6732](https://github.com/sonata-project/SonataAdminBundle/pull/6732)] Added `PagerInterface::countResults` ([@dmaicher](https://github.com/dmaicher)) +- [[#6700](https://github.com/sonata-project/SonataAdminBundle/pull/6700)] Added `AbstractAdmin::getDefaultFilterParameters()` to get default filter parameters ([@kirya-dev](https://github.com/kirya-dev)) +- [[#6746](https://github.com/sonata-project/SonataAdminBundle/pull/6746)] `Added BaseGroupMapper::removeGroup()` ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#6746](https://github.com/sonata-project/SonataAdminBundle/pull/6746)] `Added BaseGroupMapper::removeTab()` ([@VincentLanglet](https://github.com/VincentLanglet)) + +### Changed +- [[#6700](https://github.com/sonata-project/SonataAdminBundle/pull/6700)] Only changed (non default, non empty) filters will be submitted ([@kirya-dev](https://github.com/kirya-dev)) + +### Deprecated +- [[#6732](https://github.com/sonata-project/SonataAdminBundle/pull/6732)] `PagerInterface::getNbResults()` in favour of `countResults()` ([@dmaicher](https://github.com/dmaicher)) +- [[#6732](https://github.com/sonata-project/SonataAdminBundle/pull/6732)] `PagerInterface::setNbResults(...)` ([@dmaicher](https://github.com/dmaicher)) +- [[#6732](https://github.com/sonata-project/SonataAdminBundle/pull/6732)] `PagerInterface::$nbResults` ([@dmaicher](https://github.com/dmaicher)) +- [[#6735](https://github.com/sonata-project/SonataAdminBundle/pull/6735)] Deprecated `Pool::setAdminServiceIds` in favor of passing service ids as argument 2 to the constructor ([@franmomu](https://github.com/franmomu)) +- [[#6735](https://github.com/sonata-project/SonataAdminBundle/pull/6735)] Deprecated `Pool::setAdminGroups` in favor of passing service ids as argument 3 to the constructor ([@franmomu](https://github.com/franmomu)) +- [[#6735](https://github.com/sonata-project/SonataAdminBundle/pull/6735)] Deprecated `Pool::setAdminClasses` in favor of passing service ids as argument 4 to the constructor ([@franmomu](https://github.com/franmomu)) +- [[#6751](https://github.com/sonata-project/SonataAdminBundle/pull/6751)] Deprecated `CRUDController::configure()` method, to configure the associated admin, you should call `CRUDController::configureAdmin()` instead ([@franmomu](https://github.com/franmomu)) +- [[#6752](https://github.com/sonata-project/SonataAdminBundle/pull/6752)] Deprecated `TemplateRegistryInterface::TYPE_*` constants, they have been moved to `FieldDescriptionInterface` ([@franmomu](https://github.com/franmomu)) + ## [3.85.0](https://github.com/sonata-project/SonataAdminBundle/compare/3.84.0...3.85.0) - 2021-01-02 ### Added - [[#6576](https://github.com/sonata-project/SonataAdminBundle/pull/6576)] Added generics to `AdminExtensionInterface`. ([@franmomu](https://github.com/franmomu)) diff --git a/src/Admin/Pool.php b/src/Admin/Pool.php index 5f6ae12f4d..fd6b6b1bf5 100644 --- a/src/Admin/Pool.php +++ b/src/Admin/Pool.php @@ -152,7 +152,7 @@ public function __construct( } else { @trigger_error(sprintf( 'Passing other type than array as argument 2 to "%s()" is deprecated since' - .' sonata-project/admin-bundle 3.x and will throw "%s" exception in 4.0.', + .' sonata-project/admin-bundle 3.86 and will throw "%s" exception in 4.0.', __METHOD__, \TypeError::class ), E_USER_DEPRECATED); @@ -166,7 +166,7 @@ public function __construct( } else { @trigger_error(sprintf( 'Passing other type than array as argument 3 to "%s()" is deprecated since' - .' sonata-project/admin-bundle 3.x and will throw "%s" exception in 4.0.', + .' sonata-project/admin-bundle 3.86 and will throw "%s" exception in 4.0.', __METHOD__, \TypeError::class ), E_USER_DEPRECATED); @@ -558,7 +558,7 @@ public function getContainer() /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/admin-bundle 3.x, will be dropped in 4.0. Pass $adminGroups as argument 3 + * @deprecated since sonata-project/admin-bundle 3.86, will be dropped in 4.0. Pass $adminGroups as argument 3 * to the __construct method instead. * * @phpstan-param array> $adminGroups @@ -570,7 +570,7 @@ public function setAdminGroups(array $adminGroups) { if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) { @trigger_error(sprintf( - 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.x and will be removed in version 4.0.', + 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); } @@ -589,7 +589,7 @@ public function getAdminGroups() /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/admin-bundle 3.x, will be dropped in 4.0. Pass $adminGroups as argument 2 + * @deprecated since sonata-project/admin-bundle 3.86, will be dropped in 4.0. Pass $adminGroups as argument 2 * to the __construct method instead. * * @return void @@ -598,7 +598,7 @@ public function setAdminServiceIds(array $adminServiceIds) { if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) { @trigger_error(sprintf( - 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.x and will be removed in version 4.0.', + 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); } @@ -617,7 +617,7 @@ public function getAdminServiceIds() /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/admin-bundle 3.x, will be dropped in 4.0. Pass $adminGroups as argument 4 + * @deprecated since sonata-project/admin-bundle 3.86, will be dropped in 4.0. Pass $adminGroups as argument 4 * to the __construct method instead. * * @param array $adminClasses @@ -630,7 +630,7 @@ public function setAdminClasses(array $adminClasses) { if ('sonata_deprecation_mute' !== (\func_get_args()[1] ?? null)) { @trigger_error(sprintf( - 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.x and will be removed in version 4.0.', + 'Method "%s()" is deprecated since sonata-project/admin-bundle 3.86 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); } diff --git a/src/Controller/CRUDController.php b/src/Controller/CRUDController.php index b20a10dddc..bf3970a523 100644 --- a/src/Controller/CRUDController.php +++ b/src/Controller/CRUDController.php @@ -1201,13 +1201,13 @@ protected function getRestMethod() } /** - * @deprecated since sonata-project/admin-bundle 3.x, will be removed in 4.0. Use configureAdmin method instead. + * @deprecated since sonata-project/admin-bundle 3.86, will be removed in 4.0. Use configureAdmin method instead. */ protected function configure() { if ('sonata_deprecation_mute' !== (\func_get_args()[0] ?? null)) { @trigger_error(sprintf( - 'The "%s()" method is deprecated since sonata-project/admin-bundle version 3.x and will be' + 'The "%s()" method is deprecated since sonata-project/admin-bundle version 3.86 and will be' .' removed in 4.0 version.', __METHOD__ ), E_USER_DEPRECATED); diff --git a/src/Templating/TemplateRegistryInterface.php b/src/Templating/TemplateRegistryInterface.php index 4f6c604897..2a98a07154 100644 --- a/src/Templating/TemplateRegistryInterface.php +++ b/src/Templating/TemplateRegistryInterface.php @@ -23,7 +23,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_ARRAY instead. */ public const TYPE_ARRAY = 'array'; @@ -31,7 +31,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_BOOLEAN instead. */ public const TYPE_BOOLEAN = 'boolean'; @@ -39,7 +39,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_DATE instead. */ public const TYPE_DATE = 'date'; @@ -47,7 +47,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_TIME instead. */ public const TYPE_TIME = 'time'; @@ -55,7 +55,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_DATETIME instead. */ public const TYPE_DATETIME = 'datetime'; @@ -71,7 +71,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_TEXTAREA instead. */ public const TYPE_TEXTAREA = 'textarea'; @@ -79,7 +79,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_EMAIL instead. */ public const TYPE_EMAIL = 'email'; @@ -87,7 +87,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_TRANS instead. */ public const TYPE_TRANS = 'trans'; @@ -95,7 +95,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_STRING instead. */ public const TYPE_STRING = 'string'; @@ -119,7 +119,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_INTEGER instead. */ public const TYPE_INTEGER = 'integer'; @@ -135,7 +135,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_FLOAT instead. */ public const TYPE_FLOAT = 'float'; @@ -143,7 +143,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_IDENTIFIER instead. */ public const TYPE_IDENTIFIER = 'identifier'; @@ -151,7 +151,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_CURRENCY instead. */ public const TYPE_CURRENCY = 'currency'; @@ -159,7 +159,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_PERCENT instead. */ public const TYPE_PERCENT = 'percent'; @@ -167,7 +167,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_CHOICE instead. */ public const TYPE_CHOICE = 'choice'; @@ -175,7 +175,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_URL instead. */ public const TYPE_URL = 'url'; @@ -183,7 +183,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_HTML instead. */ public const TYPE_HTML = 'html'; @@ -191,7 +191,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_MANY_TO_MANY instead. */ public const TYPE_MANY_TO_MANY = 'many_to_many'; @@ -199,7 +199,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_MANY_TO_ONE instead. */ public const TYPE_MANY_TO_ONE = 'many_to_one'; @@ -207,7 +207,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_ONE_TO_MANY instead. */ public const TYPE_ONE_TO_MANY = 'one_to_many'; @@ -215,7 +215,7 @@ interface TemplateRegistryInterface /** * NEXT_MAJOR: Remove this constant. * - * @deprecated since sonata-project/admin-bundle 3.x, to be removed in 4.0. + * @deprecated since sonata-project/admin-bundle 3.86, to be removed in 4.0. * Use Sonata\AdminBundle\Admin\FieldDescriptionInterface::TYPE_ONE_TO_ONE instead. */ public const TYPE_ONE_TO_ONE = 'one_to_one'; diff --git a/tests/Admin/PoolTest.php b/tests/Admin/PoolTest.php index bafe0a1f46..7f340ac7dd 100644 --- a/tests/Admin/PoolTest.php +++ b/tests/Admin/PoolTest.php @@ -564,8 +564,8 @@ public function testSetGetTemplates(): void */ public function testDeprecatedConstructor(): void { - $this->expectDeprecation('Passing other type than array as argument 2 to "Sonata\AdminBundle\Admin\Pool::__construct()" is deprecated since sonata-project/admin-bundle 3.x and will throw "TypeError" exception in 4.0.'); - $this->expectDeprecation('Passing other type than array as argument 3 to "Sonata\AdminBundle\Admin\Pool::__construct()" is deprecated since sonata-project/admin-bundle 3.x and will throw "TypeError" exception in 4.0.'); + $this->expectDeprecation('Passing other type than array as argument 2 to "Sonata\AdminBundle\Admin\Pool::__construct()" is deprecated since sonata-project/admin-bundle 3.86 and will throw "TypeError" exception in 4.0.'); + $this->expectDeprecation('Passing other type than array as argument 3 to "Sonata\AdminBundle\Admin\Pool::__construct()" is deprecated since sonata-project/admin-bundle 3.86 and will throw "TypeError" exception in 4.0.'); new Pool($this->container, 'Sonata Admin', '/path/to/pic.png', ['foo' => 'bar']); } diff --git a/tests/Controller/CRUDControllerTest.php b/tests/Controller/CRUDControllerTest.php index b607d17075..ec8d7c9871 100644 --- a/tests/Controller/CRUDControllerTest.php +++ b/tests/Controller/CRUDControllerTest.php @@ -455,7 +455,7 @@ public function testConfigureCallsConfigureAdmin(): void $this->admin->expects($this->once()) ->method('setRequest'); - $this->expectDeprecation('The "Sonata\AdminBundle\Controller\CRUDController::configure()" method is deprecated since sonata-project/admin-bundle version 3.x and will be removed in 4.0 version.'); + $this->expectDeprecation('The "Sonata\AdminBundle\Controller\CRUDController::configure()" method is deprecated since sonata-project/admin-bundle version 3.86 and will be removed in 4.0 version.'); $this->protectedTestedMethods['configure']->invoke($this->controller); }