Skip to content

Commit 14e6f37

Browse files
committed
Removed the semaphore size from the key
1 parent 05d798b commit 14e6f37

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Symfony/Component/Semaphore/Key.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(string $resource, int $limit, int $weight = 1)
4747

4848
public function __toString(): string
4949
{
50-
return $this->resource.':'.$this->limit;
50+
return $this->resource;
5151
}
5252

5353
public function getLimit(): int

src/Symfony/Component/Semaphore/Tests/SemaphoreTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testAcquireThrowException()
7373
;
7474

7575
$this->expectException(RuntimeException::class);
76-
$this->expectExceptionMessage('Failed to acquire the "key:1" semaphore.');
76+
$this->expectExceptionMessage('Failed to acquire the "key" semaphore.');
7777

7878
$semaphore->acquire();
7979
}
@@ -124,7 +124,7 @@ public function testRefreshWhenItFails()
124124
;
125125

126126
$this->expectException(SemaphoreExpiredException::class);
127-
$this->expectExceptionMessage('The semaphore "key:1" has expired: message.');
127+
$this->expectExceptionMessage('The semaphore "key" has expired: message.');
128128

129129
$semaphore->refresh();
130130
}
@@ -143,7 +143,7 @@ public function testRefreshWhenItFailsHard()
143143
;
144144

145145
$this->expectException(RuntimeException::class);
146-
$this->expectExceptionMessage('Failed to define an expiration for the "key:1" semaphore.');
146+
$this->expectExceptionMessage('Failed to define an expiration for the "key" semaphore.');
147147

148148
$semaphore->refresh();
149149
}
@@ -177,7 +177,7 @@ public function testReleaseWhenItFails()
177177
;
178178

179179
$this->expectException(SemaphoreReleasingException::class);
180-
$this->expectExceptionMessage('The semaphore "key:1" could not be released: message.');
180+
$this->expectExceptionMessage('The semaphore "key" could not be released: message.');
181181

182182
$semaphore->release();
183183
}
@@ -196,7 +196,7 @@ public function testReleaseWhenItFailsHard()
196196
;
197197

198198
$this->expectException(RuntimeException::class);
199-
$this->expectExceptionMessage('Failed to release the "key:1" semaphore.');
199+
$this->expectExceptionMessage('Failed to release the "key" semaphore.');
200200

201201
$semaphore->release();
202202
}

0 commit comments

Comments
 (0)