improve deprecation messages

This commit is contained in:
Christian Flothmann 2018-07-06 14:02:59 +02:00
parent 02daeb29b5
commit 1657b82c19
5 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ class FirewallContext
$this->exceptionListener = $exceptionListener; $this->exceptionListener = $exceptionListener;
if ($logoutListener instanceof FirewallConfig) { if ($logoutListener instanceof FirewallConfig) {
$this->config = $logoutListener; $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) { } elseif (null === $logoutListener || $logoutListener instanceof LogoutListener) {
$this->logoutListener = $logoutListener; $this->logoutListener = $logoutListener;
$this->config = $config; $this->config = $config;

View File

@ -162,7 +162,7 @@ final class CacheItem implements CacheItemInterface
*/ */
public function getPreviousTags() 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(); return $this->metadata[self::METADATA_TAGS] ?? array();
} }

View File

@ -50,7 +50,7 @@ class AnalyzeServiceReferencesPass extends AbstractRecursivePass implements Repe
*/ */
public function setRepeatedPass(RepeatedPass $repeatedPass) 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) 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; $this->repeatedPass = $repeatedPass;
} }

View File

@ -29,7 +29,7 @@ class RemoveUnusedDefinitionsPass extends AbstractRecursivePass implements Repea
*/ */
public function setRepeatedPass(RepeatedPass $repeatedPass) 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);
} }
/** /**