Skip to content

Commit 640ecae

Browse files
Add visibility modifiers for constants
1 parent 4a1504d commit 640ecae

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

classes/mutex/MemcachedMutex.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ class MemcachedMutex extends SpinlockMutex
1919
*/
2020
private $memcache;
2121

22-
/**
23-
* The memcache key prefix.
24-
* @internal
25-
*/
26-
const PREFIX = "lockd_";
27-
2822
/**
2923
* Sets the lock's name and the connected Memcached API.
3024
*

classes/mutex/SpinlockMutex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abstract class SpinlockMutex extends LockMutex
4141
/**
4242
* The prefix for the lock key.
4343
*/
44-
const PREFIX = "lock_";
44+
private const PREFIX = "lock_";
4545

4646
/**
4747
* Sets the timeout.
@@ -54,7 +54,7 @@ public function __construct(string $name, int $timeout = 3)
5454
{
5555
$this->timeout = $timeout;
5656
$this->loop = new Loop($this->timeout);
57-
$this->key = static::PREFIX.$name;
57+
$this->key = self::PREFIX.$name;
5858
}
5959

6060
protected function lock(): void

tests/mutex/MemcachedMutexTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testFailAcquireLock()
4545
{
4646
$this->memcached->expects($this->atLeastOnce())
4747
->method("add")
48-
->with("lockd_test", true, 2)
48+
->with("lock_test", true, 2)
4949
->willReturn(false);
5050

5151
$this->mutex->synchronized(function (): void {
@@ -62,12 +62,12 @@ public function testFailReleasingLock()
6262
{
6363
$this->memcached->expects($this->once())
6464
->method("add")
65-
->with("lockd_test", true, 2)
65+
->with("lock_test", true, 2)
6666
->willReturn(true);
6767

6868
$this->memcached->expects($this->once())
6969
->method("delete")
70-
->with("lockd_test")
70+
->with("lock_test")
7171
->willReturn(false);
7272

7373
$this->mutex->synchronized(function (): void {

0 commit comments

Comments
 (0)