Skip to content

Commit 5e95789

Browse files
Enable "native_constant_invocation" CS rule
1 parent b753a4c commit 5e95789

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

Command/InitAclCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use Symfony\Component\Console\Style\SymfonyStyle;
2121
use Symfony\Component\Security\Acl\Dbal\Schema;
2222

23-
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\InitAclCommand instead.', InitAclCommand::class), E_USER_DEPRECATED);
23+
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\InitAclCommand instead.', InitAclCommand::class), \E_USER_DEPRECATED);
2424

2525
/**
2626
* Installs the tables required by the ACL system.

Command/SetAclCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Command;
1313

14-
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\SetAclCommand instead.', SetAclCommand::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\Command\SetAclCommand instead.', SetAclCommand::class), \E_USER_DEPRECATED);
1515

1616
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
1717
use Symfony\Component\Console\Exception\InvalidArgumentException;

Command/UserPasswordEncoderCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class UserPasswordEncoderCommand extends ContainerAwareCommand
4242
public function __construct(EncoderFactoryInterface $encoderFactory = null, array $userClasses = [])
4343
{
4444
if (null === $encoderFactory) {
45-
@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);
45+
@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);
4646
}
4747

4848
$this->encoderFactory = $encoderFactory;
@@ -140,7 +140,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
140140
if ($input->isInteractive() && !$emptySalt) {
141141
$emptySalt = true;
142142

143-
$errorIo->note('The command will take care of generating a salt for you. Be aware that some encoders advise to let them generate their own salt. If you\'re using one of those encoders, please answer \'no\' to the question below. '.PHP_EOL.'Provide the \'empty-salt\' option in order to let the encoder handle the generation itself.');
143+
$errorIo->note('The command will take care of generating a salt for you. Be aware that some encoders advise to let them generate their own salt. If you\'re using one of those encoders, please answer \'no\' to the question below. '.\PHP_EOL.'Provide the \'empty-salt\' option in order to let the encoder handle the generation itself.');
144144

145145
if ($errorIo->confirm('Confirm salt generation ?')) {
146146
$salt = $this->generateSalt();

DependencyInjection/Compiler/AddSecurityVotersPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function process(ContainerBuilder $container)
4646
$class = $container->getParameterBag()->resolveValue($definition->getClass());
4747

4848
if (!is_a($class, VoterInterface::class, true)) {
49-
@trigger_error(sprintf('Using a "security.voter" tag on a class without implementing the "%s" is deprecated as of 3.4 and will throw an exception in 4.0. Implement the interface instead.', VoterInterface::class), E_USER_DEPRECATED);
49+
@trigger_error(sprintf('Using a "security.voter" tag on a class without implementing the "%s" is deprecated as of 3.4 and will throw an exception in 4.0. Implement the interface instead.', VoterInterface::class), \E_USER_DEPRECATED);
5050
}
5151

5252
if (!method_exists($class, 'vote')) {

DependencyInjection/Security/Factory/HttpDigestFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class HttpDigestFactory implements SecurityFactoryInterface
2828
public function __construct($triggerDeprecation = true)
2929
{
3030
if ($triggerDeprecation) {
31-
@trigger_error(sprintf('The "%s" class and the whole HTTP digest authentication system is deprecated since Symfony 3.4 and will be removed in 4.0.', __CLASS__), E_USER_DEPRECATED);
31+
@trigger_error(sprintf('The "%s" class and the whole HTTP digest authentication system is deprecated since Symfony 3.4 and will be removed in 4.0.', __CLASS__), \E_USER_DEPRECATED);
3232
}
3333
}
3434

DependencyInjection/SecurityExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
383383
}
384384

385385
if (!$logoutOnUserChange = $firewall['logout_on_user_change']) {
386-
@trigger_error(sprintf('Not setting "logout_on_user_change" to true on firewall "%s" is deprecated as of 3.4, it will always be true in 4.0.', $id), E_USER_DEPRECATED);
386+
@trigger_error(sprintf('Not setting "logout_on_user_change" to true on firewall "%s" is deprecated as of 3.4, it will always be true in 4.0.', $id), \E_USER_DEPRECATED);
387387
}
388388

389389
if (isset($this->logoutOnUserChangeByContextKey[$contextKey]) && $this->logoutOnUserChangeByContextKey[$contextKey][1] !== $logoutOnUserChange) {
@@ -733,7 +733,7 @@ private function createSwitchUserListener($container, $id, $config, $defaultProv
733733

734734
// in 4.0, ignore the `switch_user.stateless` key if $stateless is `true`
735735
if ($stateless && false === $config['stateless']) {
736-
@trigger_error(sprintf('Firewall "%s" is configured as "stateless" but the "switch_user.stateless" key is set to false. Both should have the same value, the firewall\'s "stateless" value will be used as default value for the "switch_user.stateless" key in 4.0.', $id), E_USER_DEPRECATED);
736+
@trigger_error(sprintf('Firewall "%s" is configured as "stateless" but the "switch_user.stateless" key is set to false. Both should have the same value, the firewall\'s "stateless" value will be used as default value for the "switch_user.stateless" key in 4.0.', $id), \E_USER_DEPRECATED);
737737
}
738738

739739
$switchUserListenerId = 'security.authentication.switchuser_listener.'.$id;
@@ -837,7 +837,7 @@ private function getExpressionLanguage()
837837
*/
838838
private function getFirstProvider($firewallName, $listenerName, array $providerIds)
839839
{
840-
@trigger_error(sprintf('Listener "%s" on firewall "%s" has no "provider" set but multiple providers exist. Using the first configured provider (%s) is deprecated since Symfony 3.4 and will throw an exception in 4.0, set the "provider" key on the firewall instead.', $listenerName, $firewallName, $first = array_keys($providerIds)[0]), E_USER_DEPRECATED);
840+
@trigger_error(sprintf('Listener "%s" on firewall "%s" has no "provider" set but multiple providers exist. Using the first configured provider (%s) is deprecated since Symfony 3.4 and will throw an exception in 4.0, set the "provider" key on the firewall instead.', $listenerName, $firewallName, $first = array_keys($providerIds)[0]), \E_USER_DEPRECATED);
841841

842842
return $providerIds[$first];
843843
}

EventListener/AclSchemaListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\EventListener;
1313

14-
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\EventListener\AclSchemaListener instead.', AclSchemaListener::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('Class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Bundle\AclBundle\EventListener\AclSchemaListener instead.', AclSchemaListener::class), \E_USER_DEPRECATED);
1515

1616
use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs;
1717
use Symfony\Component\Security\Acl\Dbal\Schema;

Security/FirewallContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function getConfig()
5555
*/
5656
public function getContext()
5757
{
58-
@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);
58+
@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);
5959

6060
return [$this->getListeners(), $this->getExceptionListener(), $this->getLogoutListener()];
6161
}

Security/FirewallMap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(ContainerInterface $container, $map)
4747
public function __get($name)
4848
{
4949
if ('map' === $name || 'container' === $name) {
50-
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED);
50+
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), \E_USER_DEPRECATED);
5151

5252
if ('map' === $name && $this->map instanceof \Traversable) {
5353
$this->map = iterator_to_array($this->map);
@@ -63,7 +63,7 @@ public function __get($name)
6363
public function __set($name, $value)
6464
{
6565
if ('map' === $name || 'container' === $name) {
66-
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED);
66+
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), \E_USER_DEPRECATED);
6767

6868
$set = \Closure::bind(function ($name, $value) { $this->$name = $value; }, $this, parent::class);
6969
$set($name, $value);
@@ -78,7 +78,7 @@ public function __set($name, $value)
7878
public function __isset($name)
7979
{
8080
if ('map' === $name || 'container' === $name) {
81-
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED);
81+
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), \E_USER_DEPRECATED);
8282
}
8383

8484
return isset($this->$name);
@@ -90,7 +90,7 @@ public function __isset($name)
9090
public function __unset($name)
9191
{
9292
if ('map' === $name || 'container' === $name) {
93-
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), E_USER_DEPRECATED);
93+
@trigger_error(sprintf('Using the "%s::$%s" property is deprecated since Symfony 3.3 as it will be removed/private in 4.0.', __CLASS__, $name), \E_USER_DEPRECATED);
9494

9595
$unset = \Closure::bind(function ($name) { unset($this->$name); }, $this, parent::class);
9696
$unset($name);

Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testEncodePasswordEmptySalt()
3838
'user-class' => 'Symfony\Component\Security\Core\User\User',
3939
'--empty-salt' => true,
4040
], ['decorated' => false]);
41-
$expected = str_replace("\n", PHP_EOL, file_get_contents(__DIR__.'/app/PasswordEncode/emptysalt.txt'));
41+
$expected = str_replace("\n", \PHP_EOL, file_get_contents(__DIR__.'/app/PasswordEncode/emptysalt.txt'));
4242

4343
$this->assertEquals($expected, $this->passwordEncoderCommandTester->getDisplay());
4444
}
@@ -245,7 +245,7 @@ public function testLegacy()
245245

246246
protected function setUp()
247247
{
248-
putenv('COLUMNS='.(119 + \strlen(PHP_EOL)));
248+
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
249249
$kernel = $this->createKernel(['test_case' => 'PasswordEncode']);
250250
$kernel->boot();
251251

@@ -263,7 +263,7 @@ protected function tearDown()
263263

264264
private function setupArgon2i()
265265
{
266-
putenv('COLUMNS='.(119 + \strlen(PHP_EOL)));
266+
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
267267
$kernel = $this->createKernel(['test_case' => 'PasswordEncode', 'root_config' => 'argon2i.yml']);
268268
$kernel->boot();
269269

0 commit comments

Comments
 (0)