From 46599759441d5c5a32f2735c9f446258f846cf62 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Sat, 12 Aug 2017 12:12:58 +0200 Subject: [PATCH] Fix deprecations regarding core commands registered as services --- UPGRADE-3.4.md | 56 ++++++++++++++++++- UPGRADE-4.0.md | 50 +++++++++++++++-- src/Symfony/Bridge/Twig/CHANGELOG.md | 6 +- .../Bundle/FrameworkBundle/CHANGELOG.md | 27 +++++++++ .../Command/AssetsInstallCommand.php | 2 +- .../Command/CacheClearCommand.php | 2 +- .../Command/CachePoolClearCommand.php | 2 +- .../Command/EventDispatcherDebugCommand.php | 2 +- .../Command/RouterDebugCommand.php | 2 +- .../Command/RouterMatchCommand.php | 2 +- .../Command/TranslationDebugCommand.php | 2 +- .../Command/TranslationUpdateCommand.php | 2 +- .../Tests/Command/RouterDebugCommandTest.php | 2 +- .../Tests/Command/RouterMatchCommandTest.php | 4 +- .../Command/TranslationDebugCommandTest.php | 2 +- .../Command/TranslationUpdateCommandTest.php | 2 +- .../Functional/CachePoolClearCommandTest.php | 2 +- .../Bundle/SecurityBundle/CHANGELOG.md | 5 ++ .../SecurityBundle/Command/InitAclCommand.php | 2 +- .../SecurityBundle/Command/SetAclCommand.php | 2 +- 20 files changed, 152 insertions(+), 24 deletions(-) diff --git a/UPGRADE-3.4.md b/UPGRADE-3.4.md index 5a677088ac..ea8acec4f5 100644 --- a/UPGRADE-3.4.md +++ b/UPGRADE-3.4.md @@ -120,7 +120,52 @@ FrameworkBundle class has been deprecated and will be removed in 4.0. Use the `Symfony\Component\Translation\Reader\TranslationReader` class instead. - * The `translation.loader` service has been deprecated and will be removed in 4.0. Use the `translation.reader` service instead. + * The `translation.loader` service has been deprecated and will be removed in 4.0. + Use the `translation.reader` service instead.. + + * `AssetsInstallCommand::__construct()` now takes an instance of + `Symfony\Component\Filesystem\Filesystem` as first argument. + Not passing it is deprecated and will throw a `TypeError` in 4.0. + + * `CacheClearCommand::__construct()` now takes an instance of + `Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `CachePoolClearCommand::__construct()` now takes an instance of + `Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `EventDispatcherDebugCommand::__construct()` now takes an instance of + `Symfony\Component\EventDispatcher\EventDispatcherInterface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `RouterDebugCommand::__construct()` now takes an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `RouterMatchCommand::__construct()` now takes an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `TranslationDebugCommand::__construct()` now takes an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `TranslationUpdateCommand::__construct()` now takes an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument. Not passing it is deprecated and will throw + a `TypeError` in 4.0. + + * `AssetsInstallCommand`, `CacheClearCommand`, `CachePoolClearCommand`, + `EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`, + `TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand` + and `YamlLintCommand` classes have been marked as final HttpKernel ---------- @@ -168,6 +213,15 @@ SecurityBundle * `FirewallContext::getListeners()` now returns `\Traversable|array` + * `InitAclCommand::__construct()` now takes an instance of + `Doctrine\DBAL\Connection` as first argument. Not passing it is + deprecated and will throw a `TypeError` in 4.0. + + * `SetAclCommand::__construct()` now takes an instance of + `Symfony\Component\Security\Acl\Model\MutableAclProviderInterfaceConnection` + as first argument. Not passing it is deprecated and will throw a `TypeError` + in 4.0. + Translation ----------- diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 0b9a727a17..e54f77c228 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -419,8 +419,40 @@ FrameworkBundle class has been deprecated and will be removed in 4.0. Use the `Symfony\Component\Translation\Reader\TranslationReader` class instead. - * The `translation.loader` service has been deprecated and will be removed in 4.0. Use the `translation.reader` service instead. + * The `translation.loader` service has been removed. + Use the `translation.reader` service instead. + * `AssetsInstallCommand::__construct()` now requires an instance of + `Symfony\Component\Filesystem\Filesystem` as first argument. + + * `CacheClearCommand::__construct()` now requires an instance of + `Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface` as + first argument. + + * `CachePoolClearCommand::__construct()` now requires an instance of + `Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer` as + first argument. + + * `EventDispatcherDebugCommand::__construct()` now requires an instance of + `Symfony\Component\EventDispatcher\EventDispatcherInterface` as + first argument. + + * `RouterDebugCommand::__construct()` now requires an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument. + + * `RouterMatchCommand::__construct()` now requires an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument. + + * `TranslationDebugCommand::__construct()` now requires an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument. + + * `TranslationUpdateCommand::__construct()` now requires an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument. + HttpFoundation -------------- @@ -568,6 +600,13 @@ SecurityBundle * `UserPasswordEncoderCommand` does not extend `ContainerAwareCommand` nor implement `ContainerAwareInterface` anymore. + * `InitAclCommand::__construct()` now requires an instance of + `Doctrine\DBAL\Connection` as first argument. + + * `SetAclCommand::__construct()` now requires an instance of + `Symfony\Component\Security\Acl\Model\MutableAclProviderInterfaceConnection` + as first argument. + Serializer ---------- @@ -642,11 +681,12 @@ TwigBridge * The `TwigRendererEngine::setEnvironment()` method has been removed. Pass the Twig Environment as second argument of the constructor instead. - * Removed `Symfony\Bridge\Twig\Command\DebugCommand::set/getTwigEnvironment` and the ability - to pass a command name as first argument. + * Removed `DebugCommand::set/getTwigEnvironment`. Pass an instance of + `Twig\Environment` as first argument of the constructor instead. + + * Removed `LintCommand::set/getTwigEnvironment`. Pass an instance of + `Twig\Environment` as first argument of the constructor instead. - * Removed `Symfony\Bridge\Twig\Command\LintCommand::set/getTwigEnvironment` and the ability - to pass a command name as first argument. Validator --------- diff --git a/src/Symfony/Bridge/Twig/CHANGELOG.md b/src/Symfony/Bridge/Twig/CHANGELOG.md index c9cfec8861..397134150c 100644 --- a/src/Symfony/Bridge/Twig/CHANGELOG.md +++ b/src/Symfony/Bridge/Twig/CHANGELOG.md @@ -5,8 +5,10 @@ CHANGELOG ----- * deprecated `Symfony\Bridge\Twig\Form\TwigRenderer` - * deprecated `Symfony\Bridge\Twig\Command\DebugCommand::set/getTwigEnvironment` and the ability to pass a command name as first argument - * deprecated `Symfony\Bridge\Twig\Command\LintCommand::set/getTwigEnvironment` and the ability to pass a command name as first argument + * deprecated `DebugCommand::set/getTwigEnvironment`. Pass an instance of + `Twig\Environment` as first argument of the constructor instead + * deprecated `LintCommand::set/getTwigEnvironment`. Pass an instance of + `Twig\Environment` as first argument of the constructor instead 3.3.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 4a51222f7e..dafd4c46bb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -26,6 +26,33 @@ CHANGELOG * Deprecated `Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader`, use `Symfony\Component\Translation\Reader\TranslationReader` instead * Deprecated `translation.loader` service, use `translation.reader` instead + * `AssetsInstallCommand::__construct()` now takes an instance of + `Symfony\Component\Filesystem\Filesystem` as first argument + * `CacheClearCommand::__construct()` now takes an instance of + `Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface` as + first argument + * `CachePoolClearCommand::__construct()` now takes an instance of + `Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer` as + first argument + * `EventDispatcherDebugCommand::__construct()` now takes an instance of + `Symfony\Component\EventDispatcher\EventDispatcherInterface` as + first argument + * `RouterDebugCommand::__construct()` now takes an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument + * `RouterMatchCommand::__construct()` now takes an instance of + `Symfony\Component\Routing\RouterInteface` as + first argument + * `TranslationDebugCommand::__construct()` now takes an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument + * `TranslationUpdateCommand::__construct()` now takes an instance of + `Symfony\Component\Translation\TranslatorInterface` as + first argument + * `AssetsInstallCommand`, `CacheClearCommand`, `CachePoolClearCommand`, + `EventDispatcherDebugCommand`, `RouterDebugCommand`, `RouterMatchCommand`, + `TranslationDebugCommand`, `TranslationUpdateCommand`, `XliffLintCommand` + and `YamlLintCommand` classes have been marked as final 3.3.0 ----- diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index e1adbe9e93..1669b3d3ad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -45,7 +45,7 @@ class AssetsInstallCommand extends ContainerAwareCommand public function __construct($filesystem = null) { if (!$filesystem instanceof Filesystem) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, Filesystem::class), E_USER_DEPRECATED); parent::__construct($filesystem); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 29fa61a5f4..4080d2a3d2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -45,7 +45,7 @@ class CacheClearCommand extends ContainerAwareCommand public function __construct($cacheClearer = null, Filesystem $filesystem = null) { if (!$cacheClearer instanceof CacheClearerInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, CacheClearerInterface::class), E_USER_DEPRECATED); parent::__construct($cacheClearer); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php index dedd61e668..04719b75d7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CachePoolClearCommand.php @@ -35,7 +35,7 @@ final class CachePoolClearCommand extends ContainerAwareCommand public function __construct($poolClearer = null) { if (!$poolClearer instanceof Psr6CacheClearer) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, Psr6CacheClearer::class), E_USER_DEPRECATED); parent::__construct($poolClearer); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php index a36878d445..51f769b21d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php @@ -37,7 +37,7 @@ class EventDispatcherDebugCommand extends ContainerAwareCommand public function __construct($dispatcher = null) { if (!$dispatcher instanceof EventDispatcherInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, EventDispatcherInterface::class), E_USER_DEPRECATED); parent::__construct($dispatcher); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index 03b227a731..929264139a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -41,7 +41,7 @@ class RouterDebugCommand extends ContainerAwareCommand public function __construct($router = null) { if (!$router instanceof RouterInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, RouterInterface::class), E_USER_DEPRECATED); parent::__construct($router); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php index ee5c4990a4..1e2720669f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterMatchCommand.php @@ -39,7 +39,7 @@ class RouterMatchCommand extends ContainerAwareCommand public function __construct($router = null) { if (!$router instanceof RouterInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, RouterInterface::class), E_USER_DEPRECATED); parent::__construct($router); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index e4e16960fc..d80e2f4de9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -54,7 +54,7 @@ class TranslationDebugCommand extends ContainerAwareCommand public function __construct($translator = null, TranslationReaderInterface $reader = null, ExtractorInterface $extractor = null) { if (!$translator instanceof TranslatorInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, TranslatorInterface::class), E_USER_DEPRECATED); parent::__construct($translator); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index ff35fda56e..b2f75db5ca 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -49,7 +49,7 @@ class TranslationUpdateCommand extends ContainerAwareCommand public function __construct($writer = null, TranslationReaderInterface $reader = null, ExtractorInterface $extractor = null, $defaultLocale = null) { if (!$writer instanceof TranslationWriterInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, TranslationWriterInterface::class), E_USER_DEPRECATED); parent::__construct($writer); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php index c201fe9db7..1eaca79a8b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php @@ -49,7 +49,7 @@ class RouterDebugCommandTest extends TestCase /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand::__construct() expects an instance of "Symfony\Component\Routing\RouterInterface" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. */ public function testLegacyDebugCommand() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php index 2570d41d78..4a4fe29720 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php @@ -43,8 +43,8 @@ class RouterMatchCommandTest extends TestCase /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\RouterMatchCommand::__construct() expects an instance of "Symfony\Component\Routing\RouterInterface" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\RouterDebugCommand::__construct() expects an instance of "Symfony\Component\Routing\RouterInterface" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. */ public function testLegacyMatchCommand() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index ff7cab4589..55ed4c7449 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -176,7 +176,7 @@ class TranslationDebugCommandTest extends TestCase /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\TranslationDebugCommand::__construct() expects an instance of "Symfony\Component\Translation\TranslatorInterface" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. */ public function testLegacyDebugCommand() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php index b0804503eb..c7c93d533a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php @@ -155,7 +155,7 @@ class TranslationUpdateCommandTest extends TestCase /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand::__construct() expects an instance of "Symfony\Component\Translation\Writer\TranslationWriterInterface" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. */ public function testLegacyUpdateCommand() { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php index 9a2d198a72..a9a5959848 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/CachePoolClearCommandTest.php @@ -77,7 +77,7 @@ class CachePoolClearCommandTest extends WebTestCase /** * @group legacy - * @expectedDeprecation Passing a command name as the first argument of "Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand::__construct" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead. + * @expectedDeprecation Symfony\Bundle\FrameworkBundle\Command\CachePoolClearCommand::__construct() expects an instance of "Symfony\Component\HttpKernel\CacheClearer\Psr6CacheClearer" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0. */ public function testLegacyClearCommand() { diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index 8690a0a139..0c62ce6e2a 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -8,6 +8,11 @@ CHANGELOG `VoterInterface` on the class is now deprecated and will be removed in 4.0. * [BC BREAK] `FirewallContext::getListeners()` now returns `\Traversable|array` * added info about called security listeners in profiler + * `InitAclCommand::__construct()` now takes an instance of + `Doctrine\DBAL\Connection` as first argument + * `SetAclCommand::__construct()` now takes an instance of + `Symfony\Component\Security\Acl\Model\MutableAclProviderInterfaceConnection` + as first argument 3.3.0 ----- diff --git a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php index c8ccac32ca..72e62c3f48 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/InitAclCommand.php @@ -39,7 +39,7 @@ class InitAclCommand extends ContainerAwareCommand public function __construct($connection = null, Schema $schema = null) { if (!$connection instanceof Connection) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, Connection::class), E_USER_DEPRECATED); parent::__construct($connection); diff --git a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php index bdb293a4ec..0955129f07 100644 --- a/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php +++ b/src/Symfony/Bundle/SecurityBundle/Command/SetAclCommand.php @@ -42,7 +42,7 @@ class SetAclCommand extends ContainerAwareCommand public function __construct($provider = null) { if (!$provider instanceof MutableAclProviderInterface) { - @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version 3.4 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() expects an instance of "%s" as first argument since version 3.4. Not passing it is deprecated and will throw a TypeError in 4.0.', __METHOD__, MutableAclProviderInterface::class), E_USER_DEPRECATED); parent::__construct($provider);