10000 Enable "native_constant_invocation" CS rule · symfony/cache@01f4cc9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 01f4cc9

Browse files
Enable "native_constant_invocation" CS rule
1 parent a3e381d commit 01f4cc9

18 files changed

+29
-29
lines changed

Adapter/AbstractAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
116116
if (null !== $logger) {
117117
$fs->setLogger($logger);
118118
}
119-
if (!self::$apcuSupported || (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) {
119+
if (!self::$apcuSupported || (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) {
120120
return $fs;
121121
}
122122

Adapter/ArrayAdapter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function save(CacheItemInterface $item)
114114
$expiry = $item["\0*\0expiry"];
115115

116116
if (0 === $expiry) {
117-
$expiry = PHP_INT_MAX;
117+
$expiry = \PHP_INT_MAX;
118118
}
119119

120120
if (null !== $expiry && $expiry <= time()) {
@@ -137,7 +137,7 @@ public function save(CacheItemInterface $item)
137137
}
138138

139139
$this->values[$key] = $value;
140-
$this->expiries[$key] = null !== $expiry ? $expiry : PHP_INT_MAX;
140+
$this->expiries[$key] = null !== $expiry ? $expiry : \PHP_INT_MAX;
141141

142142
return true;
143143
}

Adapter/ChainAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(array $adapters, $defaultLifetime = 0)
4646
if (!$adapter instanceof CacheItemPoolInterface) {
4747
throw new InvalidArgumentException(sprintf('The class "%s" does not implement the "%s" interface.', \get_class($adapter), CacheItemPoolInterface::class));
4848
}
49-
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
49+
if (\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) && $adapter instanceof ApcuAdapter && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
5050
continue; // skip putting APCu in the chain when the backend is disabled
5151
}
5252

Adapter/PhpArrayAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct($file, AdapterInterface $fallbackPool)
4040
{
4141
$this->file = $file;
4242
$this->pool = $fallbackPool;
43-
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
43+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), \FILTER_VALIDATE_BOOLEAN);
4444
$this->createCacheItem = \Closure::bind(
4545
static function ($key, $value, $isHit) {
4646
$item = new CacheItem();

Adapter/PhpFilesAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
3636

3737
$e = new \Exception();
3838
$this->includeHandler = function () use ($e) { throw $e; };
39-
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
39+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), \FILTER_VALIDATE_BOOLEAN);
4040
}
4141
}

CacheItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public static function log(LoggerInterface $logger = null, $message, $context =
186186
$replace['{'.$k.'}'] = $v;
187187
}
188188
}
189-
@trigger_error(strtr($message, $replace), E_USER_WARNING);
189+
@trigger_error(strtr($message, $replace), \E_USER_WARNING);
190190
}
191191
}
192192
}

Simple/ArrayCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function setMultiple($values, $ttl = null)
121121
}
122122
}
123123
}
124-
$expiry = 0 < $ttl ? time() + $ttl : PHP_INT_MAX;
124+
$expiry = 0 < $ttl ? time() + $ttl : \PHP_INT_MAX;
125125

126126
foreach ($valuesArray as $key => $value) {
127127
$this->values[$key] = $value;

Simple/PhpArrayCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct($file, CacheInterface $fallbackPool)
3636
{
3737
$this->file = $file;
3838
$this->pool = $fallbackPool;
39-
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
39+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), \FILTER_VALIDATE_BOOLEAN);
4040
}
4141

4242
/**

Simple/PhpFilesCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public function __construct($namespace = '', $defaultLifetime = 0, $directory =
3636

3737
$e = new \Exception();
3838
$this->includeHandler = function () use ($e) { throw $e; };
39-
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), FILTER_VALIDATE_BOOLEAN);
39+
$this->zendDetectUnicode = filter_var(ini_get('zend.detect_unicode'), \FILTER_VALIDATE_BOOLEAN);
4040
}
4141
}

Tests/Adapter/ApcuAdapterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class ApcuAdapterTest extends AdapterTestCase
2424

2525
public function createCachePool($defaultLifetime = 0)
2626
{
27-
if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)) {
27+
if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN)) {
2828
$this->markTestSkipped('APCu extension is required.');
2929
}
30-
if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
30+
if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), \FILTER_VALIDATE_BOOLEAN)) {
3131
if ('testWithCliSapi' !== $this->getName()) {
3232
$this->markTestSkipped('apc.enable_cli=1 is required.');
3333
}

0 commit comments

Comments
 (0)
0