Skip to content

Commit 4351a70

Browse files
Enable "native_constant_invocation" CS rule
1 parent c653f2c commit 4351a70

File tree

429 files changed

+1354
-1353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

429 files changed

+1354
-1353
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ return PhpCsFixer\Config::create()
1313
'array_syntax' => ['syntax' => 'short'],
1414
'fopen_flags' => false,
1515
'protected_to_private' => false,
16+
'native_constant_invocation' => true,
1617
])
1718
->setRiskyAllowed(true)
1819
->setFinder(

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container)
256256
$configPath = $this->getMappingResourceConfigDirectory();
257257
$extension = $this->getMappingResourceExtension();
258258

259-
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', GLOB_NOSORT)) {
259+
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', \GLOB_NOSORT)) {
260260
$driver = 'xml';
261-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', GLOB_NOSORT)) {
261+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', \GLOB_NOSORT)) {
262262
$driver = 'yml';
263-
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', GLOB_NOSORT)) {
263+
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', \GLOB_NOSORT)) {
264264
$driver = 'php';
265265
} else {
266266
// add the closest existing directory as a resource

src/Symfony/Bridge/Doctrine/ExpressionLanguage/DoctrineParserCache.php

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

1212
namespace Symfony\Bridge\Doctrine\ExpressionLanguage;
1313

14-
@trigger_error('The '.__NAMESPACE__.'\DoctrineParserCache class is deprecated since Symfony 3.2 and will be removed in 4.0. Use the Symfony\Component\Cache\Adapter\DoctrineAdapter class instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\DoctrineParserCache class is deprecated since Symfony 3.2 and will be removed in 4.0. Use the Symfony\Component\Cache\Adapter\DoctrineAdapter class instead.', \E_USER_DEPRECATED);
1515

1616
use Doctrine\Common\Cache\Cache;
1717
use Symfony\Component\ExpressionLanguage\ParsedExpression;

src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct($manager, $class, $idReader = null, $objectLoader =
5252
{
5353
// BC to be removed and replace with type hints in 4.0
5454
if ($manager instanceof ChoiceListFactoryInterface) {
55-
@trigger_error(sprintf('Passing a ChoiceListFactoryInterface to %s is deprecated since Symfony 3.1 and will no longer be supported in 4.0. You should either call "%s::loadChoiceList" or override it to return a ChoiceListInterface.', __CLASS__, __CLASS__), E_USER_DEPRECATED);
55+
@trigger_error(sprintf('Passing a ChoiceListFactoryInterface to %s is deprecated since Symfony 3.1 and will no longer be supported in 4.0. You should either call "%s::loadChoiceList" or override it to return a ChoiceListInterface.', __CLASS__, __CLASS__), \E_USER_DEPRECATED);
5656

5757
// Provide a BC layer since $factory has changed
5858
// form first to last argument as of 3.1

src/Symfony/Bridge/Doctrine/Form/EventListener/MergeDoctrineCollectionListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function onSubmit(FormEvent $event)
4747
{
4848
if ($this->bc) {
4949
// onBind() has been overridden from a child class
50-
@trigger_error('The onBind() method is deprecated since Symfony 3.1 and will be removed in 4.0. Use the onSubmit() method instead.', E_USER_DEPRECATED);
50+
@trigger_error('The onBind() method is deprecated since Symfony 3.1 and will be removed in 4.0. Use the onSubmit() method instead.', \E_USER_DEPRECATED);
5151

5252
if (!$this->bcLayer) {
5353
// If parent::onBind() has not been called, then logic has been executed

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

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

1212
namespace Symfony\Bridge\Doctrine\HttpFoundation;
1313

14-
@trigger_error(sprintf('The class %s is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler instead.', DbalSessionHandler::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('The class %s is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler instead.', DbalSessionHandler::class), \E_USER_DEPRECATED);
1515

1616
use Doctrine\DBAL\Connection;
1717
use Doctrine\DBAL\Driver\DriverException;

src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandlerSchema.php

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

1212
namespace Symfony\Bridge\Doctrine\HttpFoundation;
1313

14-
@trigger_error(sprintf('The class %s is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::createTable instead.', DbalSessionHandlerSchema::class), E_USER_DEPRECATED);
14+
@trigger_error(sprintf('The class %s is deprecated since Symfony 3.4 and will be removed in 4.0. Use Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler::createTable instead.', DbalSessionHandlerSchema::class), \E_USER_DEPRECATED);
1515

1616
use Doctrine\DBAL\Schema\Schema;
1717

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ trait ManagerRegistryTrait
5050
*/
5151
public function setContainer(SymfonyContainerInterface $container = null)
5252
{
53-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a PSR-11 container using the constructor instead.', __METHOD__), E_USER_DEPRECATED);
53+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0. Inject a PSR-11 container using the constructor instead.', __METHOD__), \E_USER_DEPRECATED);
5454

5555
$this->container = $container;
5656
}
@@ -74,7 +74,7 @@ protected function resetService($name)
7474
$manager = $this->container->get($name);
7575

7676
if (!$manager instanceof LazyLoadingInterface) {
77-
@trigger_error(sprintf('Resetting a non-lazy manager service is deprecated since Symfony 3.2 and will throw an exception in version 4.0. Set the "%s" service as lazy and require "symfony/proxy-manager-bridge" in your composer.json file instead.', $name), E_USER_DEPRECATED);
77+
@trigger_error(sprintf('Resetting a non-lazy manager service is deprecated since Symfony 3.2 and will throw an exception in version 4.0. Set the "%s" service as lazy and require "symfony/proxy-manager-bridge" in your composer.json file instead.', $name), \E_USER_DEPRECATED);
7878

7979
$this->container->set($name, null);
8080

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct($options = [])
5757
{
5858
// BC Layer
5959
if (!\is_array($options)) {
60-
@trigger_error(sprintf('The constructor arguments $format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra of "%s" are deprecated since Symfony 3.3 and will be removed in 4.0. Use $options instead.', self::class), E_USER_DEPRECATED);
60+
@trigger_error(sprintf('The constructor arguments $format, $dateFormat, $allowInlineLineBreaks, $ignoreEmptyContextAndExtra of "%s" are deprecated since Symfony 3.3 and will be removed in 4.0. Use $options instead.', self::class), \E_USER_DEPRECATED);
6161
$args = \func_get_args();
6262
$options = [];
6363
if (isset($args[0])) {

src/Symfony/Bridge/Monolog/Handler/DebugHandler.php

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

1212
namespace Symfony\Bridge\Monolog\Handler;
1313

14-
@trigger_error('The '.__NAMESPACE__.'\DebugHandler class is deprecated since Symfony 3.2 and will be removed in 4.0. Use Symfony\Bridge\Monolog\Processor\DebugProcessor instead.', E_USER_DEPRECATED);
14+
@trigger_error('The '.__NAMESPACE__.'\DebugHandler class is deprecated since Symfony 3.2 and will be removed in 4.0. Use Symfony\Bridge\Monolog\Processor\DebugProcessor instead.', \E_USER_DEPRECATED);
1515

1616
use Monolog\Handler\TestHandler;
1717
use Monolog\Logger;

0 commit comments

Comments
 (0)