Skip to content

Commit 87cdfb2

Browse files
Enable "native_constant_invocation" CS rule
1 parent 16620a5 commit 87cdfb2

38 files changed

+126
-126
lines changed

Bundle/Bundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function registerCommands(Application $application)
171171
}
172172
$r = new \ReflectionClass($class);
173173
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
174-
@trigger_error(sprintf('Auto-registration of the command "%s" is deprecated since Symfony 3.4 and won\'t be supported in 4.0. Use PSR-4 based service discovery instead.', $class), E_USER_DEPRECATED);
174+
@trigger_error(sprintf('Auto-registration of the command "%s" is deprecated since Symfony 3.4 and won\'t be supported in 4.0. Use PSR-4 based service discovery instead.', $class), \E_USER_DEPRECATED);
175175

176176
$application->add($r->newInstance());
177177
}

CacheClearer/ChainCacheClearer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function clear($cacheDir)
4949
*/
5050
public function add(CacheClearerInterface $clearer)
5151
{
52-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED);
52+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), \E_USER_DEPRECATED);
5353

5454
$this->clearers[] = $clearer;
5555
}

CacheClearer/Psr6CacheClearer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(array $pools = [])
2727

2828
public function addPool(CacheItemPoolInterface $pool)
2929
{
30-
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass an array of pools indexed by name to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
30+
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Pass an array of pools indexed by name to the constructor instead.', __METHOD__), \E_USER_DEPRECATED);
3131

3232
$this->pools[] = $pool;
3333
}

CacheWarmer/CacheWarmerAggregate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function isOptional()
6868
*/
6969
public function setWarmers(array $warmers)
7070
{
71-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED);
71+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), \E_USER_DEPRECATED);
7272

7373
$this->warmers = [];
7474
foreach ($warmers as $warmer) {
@@ -82,7 +82,7 @@ public function setWarmers(array $warmers)
8282
public function add(CacheWarmerInterface $warmer)
8383
{
8484
if ($this->triggerDeprecation) {
85-
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), E_USER_DEPRECATED);
85+
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.4 and will be removed in 4.0, inject the list of clearers as a constructor argument instead.', __METHOD__), \E_USER_DEPRECATED);
8686
}
8787

8888
$this->warmers[] = $warmer;

Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected function filterFiles(array $files)
170170
$value->getClientOriginalName(),
171171
$value->getClientMimeType(),
172172
0,
173-
UPLOAD_ERR_INI_SIZE,
173+
\UPLOAD_ERR_INI_SIZE,
174174
true
175175
);
176176
} else {

Controller/ControllerResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function getController(Request $request)
101101
*/
102102
public function getArguments(Request $request, $controller)
103103
{
104-
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
104+
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), \E_USER_DEPRECATED);
105105

106106
if (\is_array($controller)) {
107107
$r = new \ReflectionMethod($controller[0], $controller[1]);
@@ -125,7 +125,7 @@ public function getArguments(Request $request, $controller)
125125
*/
126126
protected function doGetArguments(Request $request, $controller, array $parameters)
127127
{
128-
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), E_USER_DEPRECATED);
128+
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Implement the %s and inject it in the HttpKernel instead.', __METHOD__, ArgumentResolverInterface::class), \E_USER_DEPRECATED);
129129

130130
$attributes = $request->attributes->all();
131131
$arguments = [];

Controller/TraceableControllerResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getController(Request $request)
6060
*/
6161
public function getArguments(Request $request, $controller)
6262
{
63-
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), E_USER_DEPRECATED);
63+
@trigger_error(sprintf('The "%s()" method is deprecated as of 3.1 and will be removed in 4.0. Please use the %s instead.', __METHOD__, TraceableArgumentResolver::class), \E_USER_DEPRECATED);
6464

6565
$ret = $this->argumentResolver->getArguments($request, $controller);
6666

DataCollector/ConfigDataCollector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ public function collect(Request $request, Response $response, \Exception $except
6363
'name' => isset($this->kernel) ? $this->kernel->getName() : 'n/a',
6464
'env' => isset($this->kernel) ? $this->kernel->getEnvironment() : 'n/a',
6565
'debug' => isset($this->kernel) ? $this->kernel->isDebug() : 'n/a',
66-
'php_version' => PHP_VERSION,
66+
'php_version' => \PHP_VERSION,
6767
'php_architecture' => \PHP_INT_SIZE * 8,
6868
'php_intl_locale' => class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a',
6969
'php_timezone' => date_default_timezone_get(),
7070
'xdebug_enabled' => \extension_loaded('xdebug'),
71-
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN),
72-
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN),
71+
'apcu_enabled' => \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN),
72+
'zend_opcache_enabled' => \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN),
7373
'bundles' => [],
7474
'sapi_name' => \PHP_SAPI,
7575
];

DataCollector/DataCollector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract class DataCollector implements DataCollectorInterface, \Serializable
4545

4646
public function serialize()
4747
{
48-
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2);
48+
$trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT, 2);
4949
$isCalledFromOverridingMethod = isset($trace[1]['function'], $trace[1]['object']) && 'serialize' === $trace[1]['function'] && $this === $trace[1]['object'];
5050

5151
return $isCalledFromOverridingMethod ? $this->data : serialize($this->data);
@@ -77,7 +77,7 @@ protected function cloneVar($var)
7777
$this->cloner->setMaxItems(-1);
7878
$this->cloner->addCasters($this->getCasters());
7979
} else {
80-
@trigger_error(sprintf('Using the %s() method without the VarDumper component is deprecated since Symfony 3.2 and won\'t be supported in 4.0. Install symfony/var-dumper version 3.2 or above.', __METHOD__), E_USER_DEPRECATED);
80+
@trigger_error(sprintf('Using the %s() method without the VarDumper component is deprecated since Symfony 3.2 and won\'t be supported in 4.0. Install symfony/var-dumper version 3.2 or above.', __METHOD__), \E_USER_DEPRECATED);
8181
$this->cloner = false;
8282
}
8383
}
@@ -103,7 +103,7 @@ protected function cloneVar($var)
103103
*/
104104
protected function varToString($var)
105105
{
106-
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.2 and will be removed in 4.0. Use cloneVar() instead.', __METHOD__), E_USER_DEPRECATED);
106+
@trigger_error(sprintf('The %s() method is deprecated since Symfony 3.2 and will be removed in 4.0. Use cloneVar() instead.', __METHOD__), \E_USER_DEPRECATED);
107107

108108
if (null === $this->valueExporter) {
109109
$this->valueExporter = new ValueExporter();

DataCollector/DumpDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function dump(Data $data)
7171
$this->isCollected = false;
7272
}
7373

74-
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, 7);
74+
$trace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS, 7);
7575

7676
$file = $trace[0]['file'];
7777
$line = $trace[0]['line'];

0 commit comments

Comments
 (0)