Skip to content

Commit 26ddd81

Browse files
Merge branch '3.4' into 4.4
* 3.4: Enable "native_constant_invocation" CS rule Make AbstractPhpFileCacheWarmer public
2 parents 8eac1a5 + db5e758 commit 26ddd81

9 files changed

+22
-22
lines changed

Store/CombinedStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function save(Key $key)
9999
*/
100100
public function waitAndSave(Key $key)
101101
{
102-
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED);
102+
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), \E_USER_DEPRECATED);
103103
throw new NotSupportedException(sprintf('The store "%s" does not support blocking locks.', static::class));
104104
}
105105

Store/FlockStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private function lock(Key $key, bool $blocking)
9696

9797
// On Windows, even if PHP doc says the contrary, LOCK_NB works, see
9898
// https://bugs.php.net/54129
99-
if (!flock($handle, LOCK_EX | ($blocking ? 0 : LOCK_NB))) {
99+
if (!flock($handle, \LOCK_EX | ($blocking ? 0 : \LOCK_NB))) {
100100
fclose($handle);
101101
throw new LockConflictedException();
102102
}
@@ -124,7 +124,7 @@ public function delete(Key $key)
124124

125125
$handle = $key->getState(__CLASS__);
126126

127-
flock($handle, LOCK_UN | LOCK_NB);
127+
flock($handle, \LOCK_UN | \LOCK_NB);
128128
fclose($handle);
129129

130130
$key->removeState(__CLASS__);

Store/MemcachedStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function save(Key $key)
7676
*/
7777
public function waitAndSave(Key $key)
7878
{
79-
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED);
79+
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), \E_USER_DEPRECATED);
8080
throw new NotSupportedException(sprintf('The store "%s" does not support blocking locks.', static::class));
8181
}
8282

Store/PdoStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function save(Key $key)
135135
$this->putOffExpiration($key, $this->initialTtl);
136136
}
137137

138-
if ($this->gcProbability > 0 && (1.0 === $this->gcProbability || (random_int(0, PHP_INT_MAX) / PHP_INT_MAX) <= $this->gcProbability)) {
138+
if ($this->gcProbability > 0 && (1.0 === $this->gcProbability || (random_int(0, \PHP_INT_MAX) / \PHP_INT_MAX) <= $this->gcProbability)) {
139139
$this->prune();
140140
}
141141

@@ -147,7 +147,7 @@ public function save(Key $key)
147147
*/
148148
public function waitAndSave(Key $key)
149149
{
150-
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED);
150+
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), \E_USER_DEPRECATED);
151151
throw new NotSupportedException(sprintf('The store "%s" does not supports blocking locks.', __METHOD__));
152152
}
153153

Store/RedisStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function save(Key $key)
8080
*/
8181
public function waitAndSave(Key $key)
8282
{
83-
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED);
83+
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), \E_USER_DEPRECATED);
8484
throw new NotSupportedException(sprintf('The store "%s" does not support blocking locks.', static::class));
8585
}
8686

Store/RetryTillSaveStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RetryTillSaveStore implements BlockingStoreInterface, StoreInterface, Logg
3838
* @param int $retrySleep Duration in ms between 2 retry
3939
* @param int $retryCount Maximum amount of retry
4040
*/
41-
public function __construct(PersistingStoreInterface $decorated, int $retrySleep = 100, int $retryCount = PHP_INT_MAX)
41+
public function __construct(PersistingStoreInterface $decorated, int $retrySleep = 100, int $retryCount = \PHP_INT_MAX)
4242
{
4343
$this->decorated = $decorated;
4444
$this->retrySleep = $retrySleep;

Store/ZookeeperStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function exists(Key $key): bool
108108
*/
109109
public function waitAndSave(Key $key)
110110
{
111-
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), E_USER_DEPRECATED);
111+
@trigger_error(sprintf('%s() is deprecated since Symfony 4.4 and will be removed in Symfony 5.0.', __METHOD__), \E_USER_DEPRECATED);
112112
throw new NotSupportedException();
113113
}
114114

Tests/Store/BlockingStoreTestTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public function testBlockingLocks()
5050
$parentPID = posix_getpid();
5151

5252
// Block SIGHUP signal
53-
pcntl_sigprocmask(SIG_BLOCK, [SIGHUP]);
53+
pcntl_sigprocmask(\SIG_BLOCK, [\SIGHUP]);
5454

5555
if ($childPID = pcntl_fork()) {
5656
// Wait the start of the child
57-
pcntl_sigwaitinfo([SIGHUP], $info);
57+
pcntl_sigwaitinfo([\SIGHUP], $info);
5858

5959
$store = $this->getStore();
6060
try {
@@ -66,7 +66,7 @@ public function testBlockingLocks()
6666
}
6767

6868
// send the ready signal to the child
69-
posix_kill($childPID, SIGHUP);
69+
posix_kill($childPID, \SIGHUP);
7070

7171
// This call should be blocked by the child #1
7272
try {
@@ -82,23 +82,23 @@ public function testBlockingLocks()
8282
}
8383
} else {
8484
// Block SIGHUP signal
85-
pcntl_sigprocmask(SIG_BLOCK, [SIGHUP]);
85+
pcntl_sigprocmask(\SIG_BLOCK, [\SIGHUP]);
8686

8787
try {
8888
$store = $this->getStore();
8989
$store->save($key);
9090
// send the ready signal to the parent
91-
posix_kill($parentPID, SIGHUP);
91+
posix_kill($parentPID, \SIGHUP);
9292

9393
// Wait for the parent to be ready
94-
pcntl_sigwaitinfo([SIGHUP], $info);
94+
pcntl_sigwaitinfo([\SIGHUP], $info);
9595

9696
// Wait ClockDelay to let parent assert to finish
9797
usleep($clockDelay);
9898
$store->delete($key);
9999
exit(0);
100100
} catch (\Throwable $e) {
101-
posix_kill($parentPID, SIGHUP);
101+
posix_kill($parentPID, \SIGHUP);
102102
exit(1);
103103
}
104104
}

Tests/Store/SemaphoreStoreTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,22 @@ public function testResourceRemoval()
4747

4848
private function getOpenedSemaphores()
4949
{
50-
if ('Darwin' === PHP_OS) {
51-
$lines = explode(PHP_EOL, trim(shell_exec('ipcs -s')));
50+
if ('Darwin' === \PHP_OS) {
51+
$lines = explode(\PHP_EOL, trim(shell_exec('ipcs -s')));
5252
if (-1 === $start = array_search('Semaphores:', $lines)) {
53-
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(PHP_EOL, $lines));
53+
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore list, got '.implode(\PHP_EOL, $lines));
5454
}
5555

5656
return \count(\array_slice($lines, ++$start));
5757
}
5858

59-
$lines = explode(PHP_EOL, trim(shell_exec('LC_ALL=C ipcs -su')));
59+
$lines = explode(\PHP_EOL, trim(shell_exec('LC_ALL=C ipcs -su')));
6060
if ('------ Semaphore Status --------' !== $lines[0]) {
61-
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(PHP_EOL, $lines));
61+
throw new \Exception('Failed to extract list of opened semaphores. Expected a Semaphore status, got '.implode(\PHP_EOL, $lines));
6262
}
6363
list($key, $value) = explode(' = ', $lines[1]);
6464
if ('used arrays' !== $key) {
65-
throw new \Exception('Failed to extract list of opened semaphores. Expected a "used arrays" key, got '.implode(PHP_EOL, $lines));
65+
throw new \Exception('Failed to extract list of opened semaphores. Expected a "used arrays" key, got '.implode(\PHP_EOL, $lines));
6666
}
6767

6868
return (int) $value;

0 commit comments

Comments
 (0)