From fa317f23f53dd737c8a037f8cf367d89a6eb373d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 13 Jul 2019 18:25:19 +0200 Subject: [PATCH] fix some deprecations and add upgrade instructions --- UPGRADE-4.4.md | 14 ++++++++++++++ UPGRADE-5.0.md | 14 ++++++++++++++ .../Bundle/FrameworkBundle/Test/WebTestCase.php | 2 +- src/Symfony/Bundle/WebServerBundle/CHANGELOG.md | 5 +++++ .../WebServerBundle/Command/ServerLogCommand.php | 4 ++-- .../WebServerBundle/Command/ServerRunCommand.php | 4 ++-- .../WebServerBundle/Command/ServerStartCommand.php | 4 ++-- .../Command/ServerStatusCommand.php | 4 ++-- .../WebServerBundle/Command/ServerStopCommand.php | 4 ++-- .../DependencyInjection/WebServerExtension.php | 4 ++-- src/Symfony/Bundle/WebServerBundle/WebServer.php | 2 +- .../Bundle/WebServerBundle/WebServerBundle.php | 4 ++-- .../Bundle/WebServerBundle/WebServerConfig.php | 2 +- src/Symfony/Component/HttpKernel/CHANGELOG.md | 4 +++- src/Symfony/Component/Lock/Store/CombinedStore.php | 2 +- .../Component/Lock/Store/MemcachedStore.php | 2 +- src/Symfony/Component/Lock/Store/PdoStore.php | 2 +- src/Symfony/Component/Lock/Store/RedisStore.php | 2 +- .../Component/Lock/Store/ZookeeperStore.php | 2 +- 19 files changed, 58 insertions(+), 23 deletions(-) diff --git a/UPGRADE-4.4.md b/UPGRADE-4.4.md index 8ffb10d409..216dd7ab83 100644 --- a/UPGRADE-4.4.md +++ b/UPGRADE-4.4.md @@ -71,6 +71,7 @@ Form FrameworkBundle --------------- + * Deprecated booting the kernel before running `WebTestCase::createClient()`. * Deprecated support for `templating` engine in `TemplateController`, use Twig instead * The `$parser` argument of `ControllerResolver::__construct()` and `DelegatingLoader::__construct()` has been deprecated. @@ -90,8 +91,16 @@ HttpFoundation HttpKernel ---------- + * Implementing the `BundleInterface` without implementing the `getPublicDir()` method is deprecated. + This method will be added to the interface in 5.0. * The `DebugHandlersListener` class has been marked as `final` +Lock +---- + + * Deprecated `Symfony\Component\Lock\StoreInterface` in favor of `Symfony\Component\Lock\BlockingStoreInterface` and + `Symfony\Component\Lock\PersistStoreInterface`. + Messenger --------- @@ -143,3 +152,8 @@ WebProfilerBundle * Deprecated the `ExceptionController::templateExists()` method * Deprecated the `TemplateManager::templateExists()` method + +WebServerBundle +--------------- + + * The bundle is deprecated and will be removed in 5.0. diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md index 36ed24ff69..81c9ed02f1 100644 --- a/UPGRADE-5.0.md +++ b/UPGRADE-5.0.md @@ -208,6 +208,8 @@ Form FrameworkBundle --------------- + * Dropped support for booting the kernel before running `WebTestCase::createClient()`. `createClient()` will throw an + exception if the kernel was already booted before. * Removed the `framework.templating` option, use Twig instead. * The project dir argument of the constructor of `AssetsInstallCommand` is required. * Removed support for `bundle:controller:action` syntax to reference controllers. Use `serviceOrFqcn::method` @@ -274,6 +276,7 @@ HttpFoundation HttpKernel ---------- + * The `getPublicDir()` method has been added to the `BundleInterface`. * Removed `Client`, use `HttpKernelBrowser` instead * The `Kernel::getRootDir()` and the `kernel.root_dir` parameter have been removed * The `KernelInterface::getName()` and the `kernel.name` parameter have been removed @@ -299,6 +302,12 @@ Intl * Removed `Intl::getLocaleBundle()`, use `Locales` instead * Removed `Intl::getRegionBundle()`, use `Countries` instead +Lock +---- + + * Removed `Symfony\Component\Lock\StoreInterface` in favor of `Symfony\Component\Lock\BlockingStoreInterface` and + `Symfony\Component\Lock\PersistStoreInterface`. + Messenger --------- @@ -560,3 +569,8 @@ Yaml * The parser is now stricter and will throw a `ParseException` when a mapping is found inside a multi-line string. + +WebServerBundle +--------------- + + * The bundle has been removed. diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php index 1bcf762c47..5da58fa5b8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php @@ -40,7 +40,7 @@ abstract class WebTestCase extends KernelTestCase protected static function createClient(array $options = [], array $server = []) { if (true === static::$booted) { - @trigger_error(sprintf('Booting the kernel before calling %s::%s is deprecated and will throw in Symfony 5.0, the kernel should only be booted once.', __CLASS__, __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('Booting the kernel before calling %s() is deprecated and will throw in Symfony 5.0, the kernel should only be booted once.', __METHOD__), E_USER_DEPRECATED); } $kernel = static::bootKernel($options); diff --git a/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md b/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md index edc7417cea..b3843ca6c9 100644 --- a/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/WebServerBundle/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.4.0 +--------------- + + * The bundle is deprecated and will be removed in 5.0. + 4.2.0 ----- diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php index b841bd1805..e8d51108cc 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php @@ -26,7 +26,7 @@ use Symfony\Component\ExpressionLanguage\ExpressionLanguage; /** * @author Grégoire Pineau * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class ServerLogCommand extends Command { @@ -80,7 +80,7 @@ EOF protected function execute(InputInterface $input, OutputInterface $output) { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); $filter = $input->getOption('filter'); if ($filter) { diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php index 53c9c807ad..a33f88829f 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php @@ -27,7 +27,7 @@ use Symfony\Component\Process\Process; * * @author Michał Pipa * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class ServerRunCommand extends Command { @@ -92,7 +92,7 @@ EOF */ protected function execute(InputInterface $input, OutputInterface $output) { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php index 3e17c87bce..44008f4438 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php @@ -27,7 +27,7 @@ use Symfony\Component\EventDispatcher\EventDispatcher; * * @author Christian Flothmann * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class ServerStartCommand extends Command { @@ -92,7 +92,7 @@ EOF */ protected function execute(InputInterface $input, OutputInterface $output) { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php index 5912b9d883..e49a6c5c10 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php @@ -26,7 +26,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; * * @author Christian Flothmann * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class ServerStatusCommand extends Command { @@ -74,7 +74,7 @@ EOF */ protected function execute(InputInterface $input, OutputInterface $output) { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); $server = new WebServer($this->pidFileDirectory); diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php index 762bf6d869..fe3a6b65f7 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php @@ -24,7 +24,7 @@ use Symfony\Component\Console\Style\SymfonyStyle; * * @author Christian Flothmann * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class ServerStopCommand extends Command { @@ -63,7 +63,7 @@ EOF */ protected function execute(InputInterface $input, OutputInterface $output) { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); $io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output); diff --git a/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php b/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php index b7d5878e8c..4b4a245bd0 100644 --- a/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php +++ b/src/Symfony/Bundle/WebServerBundle/DependencyInjection/WebServerExtension.php @@ -20,7 +20,7 @@ use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; /** * @author Robin Chalas * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class WebServerExtension extends Extension { @@ -43,7 +43,7 @@ class WebServerExtension extends Extension $container->removeDefinition('web_server.command.server_log'); } - @trigger_error('Using the WebserverBundle is deprecated since 4.3, the new symfony local server has more feature, you should use it instead.'); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4, the new symfony local server has more feature, you should use it instead.', E_USER_DEPRECATED); } private function getPublicDirectory(ContainerBuilder $container) diff --git a/src/Symfony/Bundle/WebServerBundle/WebServer.php b/src/Symfony/Bundle/WebServerBundle/WebServer.php index 978c5bb17a..51efcc0be8 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServer.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServer.php @@ -20,7 +20,7 @@ use Symfony\Component\Process\Process; * * @author Fabien Potencier * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class WebServer { diff --git a/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php b/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php index 22b541fca3..59cd1c9104 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServerBundle.php @@ -14,12 +14,12 @@ namespace Symfony\Bundle\WebServerBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; /** - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class WebServerBundle extends Bundle { public function boot() { - @trigger_error('Using the WebserverBundle is deprecated since 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); + @trigger_error('Using the WebserverBundle is deprecated since Symfony 4.4. The new Symfony local server has more features, you can use it instead.', E_USER_DEPRECATED); } } diff --git a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php index e5ae3eed71..a3140bd92e 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServerConfig.php @@ -14,7 +14,7 @@ namespace Symfony\Bundle\WebServerBundle; /** * @author Fabien Potencier * - * @deprecated since version 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. + * @deprecated since Symfony 4.4, to be removed in 5.0; the new Symfony local server has more features, you can use it instead. */ class WebServerConfig { diff --git a/src/Symfony/Component/HttpKernel/CHANGELOG.md b/src/Symfony/Component/HttpKernel/CHANGELOG.md index 841b8c6635..feae351734 100644 --- a/src/Symfony/Component/HttpKernel/CHANGELOG.md +++ b/src/Symfony/Component/HttpKernel/CHANGELOG.md @@ -4,7 +4,9 @@ CHANGELOG 4.4.0 ----- -* The `DebugHandlersListener` class has been marked as `final` + * Implementing the `BundleInterface` without implementing the `getPublicDir()` method is deprecated. + This method will be added to the interface in 5.0. + * The `DebugHandlersListener` class has been marked as `final` 4.3.0 ----- diff --git a/src/Symfony/Component/Lock/Store/CombinedStore.php b/src/Symfony/Component/Lock/Store/CombinedStore.php index f2a2c4dc57..b5891af830 100644 --- a/src/Symfony/Component/Lock/Store/CombinedStore.php +++ b/src/Symfony/Component/Lock/Store/CombinedStore.php @@ -98,7 +98,7 @@ class CombinedStore implements StoreInterface, LoggerAwareInterface */ public function waitAndSave(Key $key) { - @trigger_error(sprintf('%s::%s has been deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', \get_class($this), __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED); throw new NotSupportedException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this))); } diff --git a/src/Symfony/Component/Lock/Store/MemcachedStore.php b/src/Symfony/Component/Lock/Store/MemcachedStore.php index 67b7d8eefb..962f143c76 100644 --- a/src/Symfony/Component/Lock/Store/MemcachedStore.php +++ b/src/Symfony/Component/Lock/Store/MemcachedStore.php @@ -74,7 +74,7 @@ class MemcachedStore implements StoreInterface */ public function waitAndSave(Key $key) { - @trigger_error(sprintf('%s has been deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__)); + @trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__)); throw new InvalidArgumentException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this))); } diff --git a/src/Symfony/Component/Lock/Store/PdoStore.php b/src/Symfony/Component/Lock/Store/PdoStore.php index 70e041f292..dc97630810 100644 --- a/src/Symfony/Component/Lock/Store/PdoStore.php +++ b/src/Symfony/Component/Lock/Store/PdoStore.php @@ -145,7 +145,7 @@ class PdoStore implements StoreInterface */ public function waitAndSave(Key $key) { - @trigger_error(sprintf('%s has been deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__)); + @trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__)); throw new NotSupportedException(sprintf('The store "%s" does not supports blocking locks.', __METHOD__)); } diff --git a/src/Symfony/Component/Lock/Store/RedisStore.php b/src/Symfony/Component/Lock/Store/RedisStore.php index c0ae6ea9b3..4ac41ac347 100644 --- a/src/Symfony/Component/Lock/Store/RedisStore.php +++ b/src/Symfony/Component/Lock/Store/RedisStore.php @@ -77,7 +77,7 @@ class RedisStore implements StoreInterface */ public function waitAndSave(Key $key) { - @trigger_error(sprintf('%s::%s has been deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', \get_class($this), __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED); throw new InvalidArgumentException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this))); } diff --git a/src/Symfony/Component/Lock/Store/ZookeeperStore.php b/src/Symfony/Component/Lock/Store/ZookeeperStore.php index 0de0a372f7..d089590f88 100644 --- a/src/Symfony/Component/Lock/Store/ZookeeperStore.php +++ b/src/Symfony/Component/Lock/Store/ZookeeperStore.php @@ -87,7 +87,7 @@ class ZookeeperStore implements StoreInterface */ public function waitAndSave(Key $key) { - @trigger_error(sprintf('%s::%s has been deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', \get_class($this), __METHOD__), E_USER_DEPRECATED); + @trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED); throw new NotSupportedException(); }