Skip to content

Commit

Permalink
minor #27868 improve deprecation messages (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

improve deprecation messages

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

Commits
-------

a3845c7 improve deprecation messages
  • Loading branch information
xabbuh committed Jul 9, 2018
2 parents 9a62d50 + 2a25e2a commit 5797160
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Command/UserPasswordEncoderCommand.php
Expand Up @@ -42,7 +42,7 @@ class UserPasswordEncoderCommand extends ContainerAwareCommand
public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = array())
{
if (null === $encoderFactory) {
@trigger_error(sprintf('Passing null as the first argument of "%s" is deprecated since Symfony 3.3 and will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('Passing null as the first argument of "%s()" is deprecated since Symfony 3.3 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.', __METHOD__), E_USER_DEPRECATED);
}

$this->encoderFactory = $encoderFactory;
Expand Down
2 changes: 1 addition & 1 deletion Security/FirewallContext.php
Expand Up @@ -55,7 +55,7 @@ public function getConfig()
*/
public function getContext()
{
@trigger_error(sprintf('Method %s() is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use %s::getListeners/getExceptionListener() instead.', __METHOD__, __CLASS__), E_USER_DEPRECATED);

return array($this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener());
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/UserPasswordEncoderCommandTest.php
Expand Up @@ -231,7 +231,7 @@ public function testThrowsExceptionOnNoConfiguredEncoders()

/**
* @group legacy
* @expectedDeprecation Passing null as the first argument of "Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand::__construct" is deprecated since Symfony 3.3 and will be removed in 4.0. If the command was registered by convention, make it a service instead.
* @expectedDeprecation Passing null as the first argument of "Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand::__construct()" is deprecated since Symfony 3.3 and support for it will be removed in 4.0. If the command was registered by convention, make it a service instead.
*/
public function testLegacy()
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Security/FirewallContextTest.php
Expand Up @@ -41,7 +41,7 @@ public function testGetters()
}

/**
* @expectedDeprecation Method Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext() is deprecated since Symfony 3.3 and will be removed in 4.0. Use Symfony\Bundle\SecurityBundle\Security\FirewallContext::getListeners/getExceptionListener() instead.
* @expectedDeprecation The "Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use Symfony\Bundle\SecurityBundle\Security\FirewallContext::getListeners/getExceptionListener() instead.
* @group legacy
*/
public function testGetContext()
Expand Down

0 comments on commit 5797160

Please sign in to comment.