minor #27878 improve deprecation messages (xabbuh)

This PR was merged into the 4.2-dev branch.

Discussion
----------

improve deprecation messages

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

1657b82c19 improve deprecation messages
This commit is contained in:
Fabien Potencier 2018-07-12 08:18:35 +02:00
commit 3f663fdfbb
5 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class FirewallContext
$this->exceptionListener = $exceptionListener;
if ($logoutListener instanceof FirewallConfig) {
$this->config = $logoutListener;
@trigger_error(sprintf('Passing an instance of %s as 3rd argument to %s() is deprecated since Symfony 4.2. Pass a %s instance instead.', FirewallConfig::class, __METHOD__, LogoutListener::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Passing an instance of %s as the 3rd argument to "%s()" is deprecated since Symfony 4.2. Pass a %s instance instead.', FirewallConfig::class, __METHOD__, LogoutListener::class), E_USER_DEPRECATED);
} elseif (null === $logoutListener || $logoutListener instanceof LogoutListener) {
$this->logoutListener = $logoutListener;
$this->config = $config;

View File

@ -162,7 +162,7 @@ final class CacheItem implements CacheItemInterface
*/
public function getPreviousTags()
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.2, use the "getMetadata()" method instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2, use the "getMetadata()" method instead.', __METHOD__), E_USER_DEPRECATED);
return $this->metadata[self::METADATA_TAGS] ?? array();
}

View File

@ -50,7 +50,7 @@ class AnalyzeServiceReferencesPass extends AbstractRecursivePass implements Repe
*/
public function setRepeatedPass(RepeatedPass $repeatedPass)
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
/**

View File

@ -42,7 +42,7 @@ class InlineServiceDefinitionsPass extends AbstractRecursivePass implements Repe
*/
public function setRepeatedPass(RepeatedPass $repeatedPass)
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
$this->repeatedPass = $repeatedPass;
}

View File

@ -29,7 +29,7 @@ class RemoveUnusedDefinitionsPass extends AbstractRecursivePass implements Repea
*/
public function setRepeatedPass(RepeatedPass $repeatedPass)
{
@trigger_error(sprintf('The "%s" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.2.', __METHOD__), E_USER_DEPRECATED);
}
/**