Skip to content

Commit

Permalink
3.86 (#6756)
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 9, 2021
1 parent baaea97 commit d287c60
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 34 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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))
Expand Down
16 changes: 8 additions & 8 deletions src/Admin/Pool.php
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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<string, array<string, mixed>> $adminGroups
Expand All @@ -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);
}
Expand All @@ -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
Expand All @@ -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);
}
Expand All @@ -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<string, string[]> $adminClasses
Expand All @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/CRUDController.php
Expand Up @@ -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);
Expand Down
42 changes: 21 additions & 21 deletions src/Templating/TemplateRegistryInterface.php
Expand Up @@ -23,39 +23,39 @@ 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';
Expand All @@ -71,31 +71,31 @@ 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';

/**
* 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';

/**
* 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';

/**
* 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';
Expand All @@ -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';
Expand All @@ -135,87 +135,87 @@ 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';

/**
* 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';
Expand Down
4 changes: 2 additions & 2 deletions tests/Admin/PoolTest.php
Expand Up @@ -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']);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Controller/CRUDControllerTest.php
Expand Up @@ -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);
}
Expand Down

0 comments on commit d287c60

Please sign in to comment.