Skip to content

Commit f339abf

Browse files
authored
Merge pull request #5 from msmakouz/docs
Fix documentation links
2 parents 774864e + edb7432 commit f339abf

File tree

7 files changed

+36
-10
lines changed

7 files changed

+36
-10
lines changed

.github/workflows/phpunit.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ jobs:
1212
with:
1313
os: >-
1414
['ubuntu-latest']
15-
php: >-
16-
['8.1', '8.2']
1715
stability: >-
1816
['prefer-stable']

.github/workflows/psalm.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ jobs:
1212
with:
1313
os: >-
1414
['ubuntu-latest']
15-
php: >-
16-
['8.1']

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
[![Latest Stable Version](https://poser.pugx.org/roadrunner-php/symfony-lock-driver/v/stable)](https://packagist.org/packages/roadrunner-php/symfony-lock-driver)
1212
[![phpunit](https://github.com/roadrunner-php/symfony-lock-driver/actions/workflows/phpunit.yml/badge.svg)](https://github.com/roadrunner-php/symfony-lock-driver/actions)
1313
[![psalm](https://github.com/roadrunner-php/symfony-lock-driver/actions/workflows/psalm.yml/badge.svg)](https://github.com/roadrunner-php/symfony-lock-driver/actions)
14-
[![Codecov](https://codecov.io/gh/roadrunner-php/symfony-lock-driver/branch/master/graph/badge.svg)](https://codecov.io/gh/roadrunner-php/symfony-lock-driver/)
14+
[![Codecov](https://codecov.io/gh/roadrunner-php/symfony-lock-driver/branch/1.x/graph/badge.svg)](https://codecov.io/gh/roadrunner-php/symfony-lock-driver/)
1515
[![Total Downloads](https://poser.pugx.org/roadrunner-php/symfony-lock-driver/downloads)](https://packagist.org/roadrunner-php/symfony-lock-driver/phpunit)
1616
<a href="https://discord.gg/8bZsjYhVVk"><img src="https://img.shields.io/badge/discord-chat-magenta.svg"></a>
1717

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"email": "gam6itko@gmail.com"
2121
}
2222
],
23-
"homepage": "https://spiral.dev/",
23+
"homepage": "https://roadrunner.dev",
2424
"support": {
25-
"docs": "https://roadrunner.dev/docs",
25+
"docs": "https://docs.roadrunner.dev",
2626
"issues": "https://github.com/roadrunner-server/roadrunner/issues",
2727
"forum": "https://forum.roadrunner.dev/",
2828
"chat": "https://discord.gg/V6EK4he"

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xmlns="https://getpsalm.org/schema/config"
66
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
findUnusedBaselineEntry="true"
8+
findUnusedCode="false"
79
>
810
<projectFiles>
911
<directory name="src"/>

src/RoadRunnerStore.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Symfony\Component\Lock\BlockingStoreInterface;
1010
use Symfony\Component\Lock\Exception\LockAcquiringException;
1111
use Symfony\Component\Lock\Exception\LockConflictedException;
12-
use Symfony\Component\Lock\Exception\LockReleasingException;
1312
use Symfony\Component\Lock\Key;
1413
use Symfony\Component\Lock\SharedLockStoreInterface;
1514
use Symfony\Component\Lock\Store\ExpiringStoreTrait;
@@ -122,8 +121,8 @@ public function waitAndSave(Key $key): void
122121
$status = $this->lock->lock($resource, $lockId, $this->initialTtl, $this->initialWaitTtl);
123122

124123
$key->setState(__CLASS__, $lockId);
125-
if (!$status) {
126-
throw new LockConflictedException();
124+
if ($status === false) {
125+
throw new LockConflictedException('RoadRunner. Failed to make lock');
127126
}
128127

129128
$this->checkNotExpired($key);

tests/RoadRunnerStoreTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,4 +161,33 @@ public function testDeleteFail(): void
161161
$key->setState(RoadRunnerStore::class, 'lock-id');
162162
$store->delete($key);
163163
}
164+
165+
public function testWaitAndSaveSuccess(): void
166+
{
167+
$this->rrLock->expects($this->once())
168+
->method('lock')
169+
->with('resource-name', 'random-id', 300, 60)
170+
->willReturn('lock-id');
171+
172+
$store = new RoadRunnerStore($this->rrLock, $this->tokens);
173+
$key = new Key('resource-name');
174+
$store->waitAndSave($key);
175+
176+
$this->assertTrue($key->hasState(RoadRunnerStore::class));
177+
$this->assertSame('random-id', $key->getState(RoadRunnerStore::class));
178+
}
179+
180+
public function testWaitAndSaveFail(): void
181+
{
182+
$this->expectException(LockConflictedException::class);
183+
$this->expectExceptionMessage('RoadRunner. Failed to make lock');
184+
185+
$this->rrLock->expects($this->once())
186+
->method('lock')
187+
->with('resource-name', 'random-id', 300, 60)
188+
->willReturn(false);
189+
190+
$store = new RoadRunnerStore($this->rrLock, $this->tokens);
191+
$store->waitAndSave(new Key('resource-name'));
192+
}
164193
}

0 commit comments

Comments
 (0)