8000 Make deprecation notices less verbose by fabpot · Pull Request #26225 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Make deprecation notices less verbose #26225

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
Feb 19, 2018
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
30 changes: 14 additions & 16 deletions UPGRADE-4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,46 @@ Config
------

* Implementing `ParentNodeDefinitionInterface` without the `getChildNodeDefinitions()` method
is deprecated and will be unsupported in 5.0.
is deprecated.

EventDispatcher
---------------

* The `TraceableEventDispatcherInterface` has been deprecated and will be removed in 5.0.
* The `TraceableEventDispatcherInterface` has been deprecated.

FrameworkBundle
---------------

* A `RouterInterface` that does not implement the `WarmableInterface` is deprecated and will not be supported in Symfony 5.0.
* The `RequestDataCollector` class has been deprecated and will be removed in Symfony 5.0. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
* A `RouterInterface` that does not implement the `WarmableInterface` is deprecated.
* The `RequestDataCollector` class has been deprecated. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.

HttpFoundation
--------------

* Passing the file size to the constructor of the `UploadedFile` class is deprecated and won't be
supported anymore in 5.0.
* Passing the file size to the constructor of the `UploadedFile` class is deprecated.

* The `getClientSize()` method of the `UploadedFile` class is deprecated. Use `getSize()` instead.

Security
--------

* The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0.
* The `ContextListener::setLogoutOnUserChange()` method is deprecated.
* Using the `AdvancedUserInterface` is now deprecated. To use the existing
functionality, create a custom user-checker based on the
`Symfony\Component\Security\Core\User\UserChecker`. This functionality will
be removed in Symfony 5.0.
`Symfony\Component\Security\Core\User\UserChecker`.

SecurityBundle
--------------

* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.
* The `SecurityUserValueResolver` class is deprecated and will be removed in 5.0, use
* The `logout_on_user_change` firewall option is deprecated.
* The `SecurityUserValueResolver` class is deprecated, use
`Symfony\Component\Security\Http\Controller\UserValueResolver` instead.

Translation
-----------

* The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0.
* The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0.
* The `FileDumper::setBackup()` method is deprecated.
* The `TranslationWriter::disableBackup()` method is deprecated.

TwigBundle
----------
Expand All @@ -56,9 +54,9 @@ TwigBundle
Validator
--------

* The `Email::__construct()` 'strict' property is deprecated and will be removed in 5.0. Use 'mode'=>"strict" instead.
* Calling `EmailValidator::__construct()` method with a boolean parameter is deprecated and will be removed in 5.0, use `EmailValidator("strict")` instead.
* Deprecated the `checkDNS` and `dnsMessage` options of the `Url` constraint. They will be removed in 5.0.
* The `Email::__construct()` 'strict' property is deprecated. Use 'mode'=>"strict" instead.
* Calling `EmailValidator::__construct()` method with a boolean parameter is deprecated, use `EmailValidator("strict")` instead.
* Deprecated the `checkDNS` and `dnsMessage` options of the `Url` constraint.

Workflow
--------
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CHANGELOG
* Added a new `parameter_bag` service with related autowiring aliases to access parameters as-a-service
* Allowed the `Router` to work with any PSR-11 container
* Added option in workflow dump command to label graph with a custom label
* Using a `RouterInterface` that does not implement the `WarmableInterface` is deprecated and will not be supported in Symfony 5.0.
* The `RequestDataCollector` class has been deprecated and will be removed in Symfony 5.0. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
* Using a `RouterInterface` that does not implement the `WarmableInterface` is deprecated.
* The `RequestDataCollector` class has been deprecated. Use the `Symfony\Component\HttpKernel\DataCollector\RequestDataCollector` class instead.
* The `RedirectController` class allows for 307/308 HTTP status codes

4.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

use Symfony\Component\HttpKernel\DataCollector\RequestDataCollector as BaseRequestDataCollector;

@trigger_error(sprintf('The "%s" class is deprecated since version 4.1 and will be removed in Symfony 5.0. Use %s instead.', RequestDataCollector::class, BaseRequestDataCollector::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1. Use %s instead.', RequestDataCollector::class, BaseRequestDataCollector::class), E_USER_DEPRECATED);

/**
* RequestDataCollector.
*
* @author Jules Pietri <jusles@heahprod.com>
*
* @deprecated since version 4.1, to be removed in Symfony 5.0
* @deprecated since Symfony 4.1
*/
class RequestDataCollector extends BaseRequestDataCollector
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</service>

<service id="session.save_listener" class="Symfony\Component\HttpKernel\EventListener\SaveSessionListener">
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1 and will be removed in 5.0. Use the "session_listener" service instead.</deprecated>
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1. Use the "session_listener" service instead.</deprecated>
</service>

<!-- for BC -->
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHANGELOG
4.1.0
-----

* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.
* The `logout_on_user_change` firewall option is deprecated.
* deprecated `SecurityUserValueResolver`, use
`Symfony\Component\Security\Http\Controller\UserValueResolver` instead.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->booleanNode('logout_on_user_change')
->defaultTrue()
->info('When true, it will trigger a logout for the user if something has changed. Note: No-Op option since 4.0. Will always be true.')
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1 and will be removed in 5.0.')
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1.')
->end()
->arrayNode('logout')
->treatTrueLike(array())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
<!-- Provisioning -->
<service id="security.user.provider.in_memory" class="Symfony\Component\Security\Core\User\InMemoryUserProvider" abstract="true" />
<service id="security.user.provider.in_memory.user" class="Symfony\Component\Security\Core\User\User" abstract="true">
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1 and will be removed in 5.0.</deprecated>
<deprecated>The "%service_id%" service is deprecated since Symfony 4.1.</deprecated>
</service>

<service id="security.user.provider.ldap" class="Symfony\Component\Security\Core\User\LdapUserProvider" abstract="true">
Expand Down
10000
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Http\Controller\UserValueResolver;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1 and will be removed in 5.0, use "%s" instead.', SecurityUserValueResolver::class, UserValueResolver::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1, use "%s" instead.', SecurityUserValueResolver::class, UserValueResolver::class), E_USER_DEPRECATED);

/**
* Supports the argument type of {@see UserInterface}.
*
* @author Iltar van der Berg <kjarli@gmail.com>
*
* @deprecated since Symfony 4.1, to be removed in 5.0. Use {@link UserValueResolver} instead
* @deprecated since Symfony 4.1, use {@link UserValueResolver} instead
*/
final class SecurityUserValueResolver implements ArgumentValueResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public function setPathSeparator(string $separator)
$child->setPathSeparator($separator);
}
} else {
@trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since version 4.1 and will be removed in 5.0.', E_USER_DEPRECATED);
@trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since Symfony 4.1.', E_USER_DEPRECATED);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/EventDispatcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CHANGELOG

* added support for invokable event listeners tagged with `kernel.event_listener` by default
* The `TraceableEventDispatcher::getOrphanedEvents()` method has been added.
* The `TraceableEventDispatcherInterface` has been deprecated and will be removed in 5.0.
* The `TraceableEventDispatcherInterface` has been deprecated.

4.0.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
* @deprecated since version 4.1, will be removed in 5.0.
* @deprecated since version 4.1
*
* @author Fabien Potencier <fabien@symfony.com>
*/
Expand Down
11 changes: 4 additions & 7 deletions src/Symfony/Component/HttpFoundation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ CHANGELOG
4.1.0
-----

* Passing the file size to the constructor of the `UploadedFile` class is deprecated and won't be
supported anymore in 5.0.

* Passing the file size to the constructor of the `UploadedFile` class is deprecated.
* The `getClientSize()` method of the `UploadedFile` class is deprecated. Use `getSize()` instead.
* added `RedisSessionHandler` to use Redis as a session storage

* The `get()` method of the `AcceptHeader` class now takes into account the
`*` and `*/*` default values (if they are present in the Accept HTTP header)
when looking for items.
* The `get()` method of the `AcceptHeader` class now takes into account the
`*` and `*/*` default values (if they are present in the Accept HTTP header)
when looking for items.

4.0.0
-----
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/HttpFoundation/File/UploadedFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct(string $path, string $originalName, string $mimeType
$this->mimeType = $mimeType ?: 'application/octet-stream';

if (4 < func_num_args() ? !is_bool($test) : null !== $error && @filesize($path) === $error) {
@trigger_error(sprintf('Passing a size as 4th argument to the constructor of "%s" is deprecated since Symfony 4.1 and will be unsupported in 5.0.', __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('Passing a size as 4th argument to the constructor of "%s" is deprecated since Symfony 4.1.', __CLASS__), E_USER_DEPRECATED);
$error = $test;
$test = 5 < func_num_args() ? func_get_arg(5) : false;
}
Expand Down Expand Up @@ -145,13 +145,13 @@ public function guessClientExtension()
* It is extracted from the request from which the file has been uploaded.
* Then it should not be considered as a safe value.
*
* @deprecated since 4.1 will be removed in 5.0 use getSize() instead.
* @deprecated since 4.1, use getSize() instead.
*
* @return int|null The file sizes
*/
public function getClientSize()
{
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.1 and will be removed in 5.0. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('"%s" is deprecated since Symfony 4.1. Use getSize() instead.', __METHOD__), E_USER_DEPRECATED);

return $this->getSize();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function testGetSize()

/**
* @group legacy
* @expectedDeprecation Passing a size as 4th argument to the constructor of "Symfony\Component\HttpFoundation\File\UploadedFile" is deprecated since Symfony 4.1 and will be unsupported in 5.0.
* @expectedDeprecation Passing a size as 4th argument to the constructor of "Symfony\Component\HttpFoundation\File\UploadedFile" is deprecated since Symfony 4.1.
*/
public function testConstructDeprecatedSize()
{
Expand All @@ -213,7 +213,7 @@ public function testConstructDeprecatedSize()

/**
* @group legacy
* @expectedDeprecation Passing a size as 4th argument to the constructor of "Symfony\Component\HttpFoundation\File\UploadedFile" is deprecated since Symfony 4.1 and will be unsupported in 5.0.
* @expectedDeprecation Passing a size as 4th argument to the constructor of "Symfony\Component\HttpFoundation\File\UploadedFile" is deprecated since Symfony 4.1.
*/
public function testConstructDeprecatedSizeWhenPassingOnlyThe4Needed()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\HttpKernel\EventListener;

@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1 and will be removed in 5.0. Use AbstractSessionListener instead.', SaveSessionListener::class), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.1, use AbstractSessionListener instead.', SaveSessionListener::class), E_USER_DEPRECATED);

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
Expand All @@ -20,7 +20,7 @@
/**
* @author Tobias Schultze <http://tobion.de>
*
* @deprecated since Symfony 4.1, to be removed in 5.0. Use AbstractSessionListener instead.
10000 * @deprecated since Symfony 4.1, use AbstractSessionListener instead
*/
class SaveSessionListener implements EventSubscriberInterface
{
Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Component/Security/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ CHANGELOG
4.1.0
-----

* The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0.
* The `ContextListener::setLogoutOnUserChange()` method is deprecated.
* added `UserValueResolver`.
* Using the AdvancedUserInterface is now deprecated. To use the existing
functionality, create a custom user-checker based on the
`Symfony\Component\Security\Core\User\UserChecker`. This functionality will
be removed in Symfony 5.0.
`Symfony\Component\Security\Core\User\UserChecker`.

4.0.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ private function hasUserChanged(UserInterface $user)
}

if ($this->user instanceof AdvancedUserInterface && $user instanceof AdvancedUserInterface) {
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1 and will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
if ($this->user->isAccountNonExpired() !== $user->isAccountNonExpired()) {
return true;
}
Expand All @@ -278,7 +278,7 @@ private function hasUserChanged(UserInterface $user)
return true;
}
} elseif ($this->user instanceof AdvancedUserInterface xor $user instanceof AdvancedUserInterface) {
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1 and will be removed in 5.0. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Checking for the AdvancedUserInterface in %s has been deprecated in 4.1. Implement the %s to check if the user has been changed,', __METHOD__, EquatableInterface::class), E_USER_DEPRECATED);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testCheckPostAuthPass()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
*/
public function testCheckPostAuthPassAdvancedUser()
{
Expand All @@ -55,7 +55,7 @@ public function testCheckPostAuthCredentialsExpired()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPostAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
* @expectedException \Symfony\Component\Security\Core\Exception\CredentialsExpiredException
*/
public function testCheckPostAuthCredentialsExpiredAdvancedUser()
Expand All @@ -70,7 +70,7 @@ public function testCheckPostAuthCredentialsExpiredAdvancedUser()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
*/
public function testCheckPreAuthPassAdvancedUser()
{
Expand All @@ -95,7 +95,7 @@ public function testCheckPreAuthAccountLocked()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
* @expectedException \Symfony\Component\Security\Core\Exception\LockedException
*/
public function testCheckPreAuthAccountLockedAdvancedUser()
Expand All @@ -119,7 +119,7 @@ public function testCheckPreAuthDisabled()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
* @expectedException \Symfony\Component\Security\Core\Exception\DisabledException
*/
public function testCheckPreAuthDisabledAdvancedUser()
Expand All @@ -144,7 +144,7 @@ public function testCheckPreAuthAccountExpired()

/**
* @group legacy
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated as of 4.1 and will be removed in 5.0. Create a custom user checker if you wish to keep this functionality.
* @expectedDeprecation Calling Symfony\Component\Security\Core\User\UserChecker::checkPreAuth with an AdvancedUserInterface is deprecated since Symfony 4.1. Create a custom user checker if you wish to keep this functionality.
* @expectedException \Symfony\Component\Security\Core\Exception\AccountExpiredException
*/
public function testCheckPreAuthAccountExpiredAdvancedUser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @see UserInterface
* @see AccountStatusException
* @deprecated since version 4.1, will be removed in 5.0.
* @deprecated since version 4.1
*
* @author Fabien Potencier <fabien@symfony.com>
*/
Expand Down
Loading
0