Skip to content

Commit 25474c1

Browse files
committed
test(lock): document unsupported store path for analysis
- Add intersection PHPDoc for LockManager cache-store requirements - Keep the runtime LockException for unsupported cache handlers - Add targeted PHPStan ignore for the test that intentionally exercises the exception path" Signed-off-by: memleakd <121398829+memleakd@users.noreply.github.com>
1 parent 500466a commit 25474c1

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

system/Lock/LockManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
private LockStoreInterface $store;
2727

2828
/**
29-
* @param CacheInterface $cache Cache handler that must also implement LockStoreProviderInterface.
29+
* @param CacheInterface&LockStoreProviderInterface $cache Cache handler that supports lock stores.
3030
*
3131
* @throws LockException When the cache handler does not support locks.
3232
*/

tests/system/Lock/LockTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ public function testUnsupportedCacheHandlerThrows(): void
194194
$this->expectException(LockException::class);
195195
$this->expectExceptionMessage('does not support locks');
196196

197+
// @phpstan-ignore argument.type
197198
new LockManager(CacheFactory::getHandler($this->config, 'dummy'));
198199
}
199200

0 commit comments

Comments
 (0)