8000 Remove old version check · symfony/symfony@6c93d1f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 6c93d1f

Browse files
committed
Remove old version check
1 parent f41bdf1 commit 6c93d1f

File tree

4 files changed

+9
-23
lines changed

4 files changed

+9
-23
lines changed

src/Symfony/Component/Console/Command/LockableTrait.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ private function lock($name = null, $blocking = false)
4343
throw new LogicException('A lock is already in place.');
4444
}
4545

46-
if (SemaphoreStore::isSupported($blocking)) {
47-
$store = new SemaphoreStore();
48-
} else {
49-
$store = new FlockStore(sys_get_temp_dir());
50-
}
46+
$store = SemaphoreStore::isSupported() ? new SemaphoreStore() : new FlockStore(sys_get_temp_dir());
5147

5248
$this->lock = (new Factory($store))->createLock($name ?: $this->getName());
5349
if (!$this->lock->acquire($blocking)) {

src/Symfony/Component/Console/Tests/Command/LockableTraitTest.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ public function testLockIsReleased()
4040
public function testLockReturnsFalseIfAlreadyLockedByAnotherCommand()
4141
{
4242
$command = new \FooLockCommand();
43-
44-
if (SemaphoreStore::isSupported(false)) {
45-
$store = new SemaphoreStore();
46-
} else {
47-
$store = new FlockStore(sys_get_temp_dir());
48-
}
43+
$store = SemaphoreStore::isSupported() ? new SemaphoreStore() : new FlockStore(sys_get_temp_dir());
4944

5045
$lock = (new Factory($store))->createLock($command->getName());
5146
$lock->acquire();

src/Symfony/Component/Lock/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* removed the `$blocking` argument of the `SemaphoreStore::isSupported()` method
8+
49
3.4.0
510
-----
611

src/Symfony/Component/Lock/Store/SemaphoreStore.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@ class SemaphoreStore implements StoreInterface
2727
/**
2828
* Returns whether or not the store is supported.
2929
*
30-
* @param bool|null $blocking When not null, checked again the blocking mode.
31-
*
3230
* @return bool
3331
*/
34-
public static function isSupported($blocking = null)
32+
public static function isSupported()
3533
{
36-
if (!extension_loaded('sysvsem')) {
37-
return false;
38-
}
39-
40-
if ($blocking === false && \PHP_VERSION_ID < 50601) {
41-
return false;
42-
}
43-
44-
return true;
34+
return extension_loaded('sysvsem');
4535
}
4636

4737
public function __construct()

0 commit comments

Comments
 (0)
0