Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix some deprecations and add upgrade instructions #32533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix some deprecations and add upgrade instructions
  • Loading branch information
xabbuh committed Jul 14, 2019
commit fa317f23f53dd737c8a037f8cf367d89a6eb373d
14 changes: 14 additions & 0 deletions UPGRADE-4.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
---------

Expand Down Expand Up @@ -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.
14 changes: 14 additions & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
Expand All @@ -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
---------

Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function doTearDown(): void
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);
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.4.0
---------------

* The bundle is deprecated and will be removed in 5.0.

4.2.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* @author Grégoire Pineau <[email protected]>
*
* @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
{
Expand Down Expand Up @@ -80,7 +80,7 @@ protected function configure()

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @author Michał Pipa <[email protected]>
*
* @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
{
Expand Down Expand Up @@ -92,7 +92,7 @@ protected function configure()
*/
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @author Christian Flothmann <[email protected]>
*
* @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
{
Expand Down Expand Up @@ -92,7 +92,7 @@ protected function configure()
*/
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @author Christian Flothmann <[email protected]>
*
* @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
{
Expand Down Expand Up @@ -74,7 +74,7 @@ protected function configure()
*/
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author Christian Flothmann <[email protected]>
*
* @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
{
Expand Down Expand Up @@ -63,7 +63,7 @@ protected function configure()
*/
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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* @author Robin Chalas <[email protected]>
*
* @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
{
Expand All @@ -43,7 +43,7 @@ public function load(array $configs, ContainerBuilder $container)
$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)
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/WebServerBundle/WebServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Fabien Potencier <[email protected]>
*
* @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
{
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/WebServerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
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);
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/WebServerBundle/WebServerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* @author Fabien Potencier <[email protected]>
*
* @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
{
Expand Down
4 changes: 3 additions & 1 deletion src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/CombinedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function save(Key $key)
*/
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)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/MemcachedStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function save(Key $key)
*/
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__));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated all of this in a PR already ;)

Copy link
Member Author

@xabbuh xabbuh Jul 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must have missed that one. :) So I am gonna rebase here afterwards.

throw new InvalidArgumentException(sprintf('The store "%s" does not supports blocking locks.', \get_class($this)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/PdoStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function save(Key $key)
*/
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__));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/RedisStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function save(Key $key)
*/
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)));
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/ZookeeperStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function exists(Key $key): bool
*/
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();
}

Expand Down