Skip to content

Commit

Permalink
return types iter
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 3, 2024
1 parent 384e47b commit 7942bf1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/exception/PhpLockException.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
/**
* Common php-lock/lock exception interface.
*
* @method string getMessage()
* @method int getCode()
* @method string getFile()
* @method int getLine()
* @method array getTrace()
* @method string getTraceAsString()
* @method \Throwable|null getPrevious()
* @method string __toString()
* @method string getMessage()
* @method int getCode()
* @method string getFile()
* @method int getLine()
* @method list<array<string, mixed>> getTrace()
* @method string getTraceAsString()
* @method \Throwable|null getPrevious()
* @method string __toString()
*/
interface PhpLockException {}
9 changes: 6 additions & 3 deletions tests/mutex/FlockMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function tearDown(): void
/**
* @param FlockMutex::STRATEGY_* $strategy
*
* @dataProvider dpTimeoutableStrategiesCases
* @dataProvider provideTimeoutableStrategiesCases
*/
public function testCodeExecutedOutsideLockIsNotThrown(int $strategy): void
{
Expand All @@ -52,7 +52,7 @@ public function testCodeExecutedOutsideLockIsNotThrown(int $strategy): void
/**
* @param FlockMutex::STRATEGY_* $strategy
*
* @dataProvider dpTimeoutableStrategiesCases
* @dataProvider provideTimeoutableStrategiesCases
*/
public function testTimeoutOccurs(int $strategy): void
{
Expand All @@ -75,7 +75,10 @@ static function () {
}
}

public static function dpTimeoutableStrategiesCases(): iterable
/**
* @return iterable<list<mixed>>
*/
public static function provideTimeoutableStrategiesCases(): iterable
{
return [
[FlockMutex::STRATEGY_PCNTL],
Expand Down
2 changes: 2 additions & 0 deletions tests/mutex/MutexConcurrencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ public function testHighContention(callable $code, callable $mutexFactory): void

/**
* Returns test cases for testHighContention().
*
* @return iterable<list<mixed>>
*/
public function provideHighContentionCases(): iterable
{
Expand Down
3 changes: 3 additions & 0 deletions tests/mutex/PHPRedisMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ public function testResistantToPartialClusterFailuresForReleasingLock(): void
}));
}

/**
* @return iterable<list<mixed>>
*/
public static function provideSerializersAndCompressorsCases(): iterable
{
if (!class_exists(\Redis::class)) {
Expand Down
2 changes: 1 addition & 1 deletion tests/mutex/RedisMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function testTimingOut(int $count, float $timeout, float $delay): void
/**
* Returns test cases for testTimingOut().
*
* @return array test cases
* @return iterable<list<mixed>>
*/
public static function provideTimingOutCases(): iterable
{
Expand Down
2 changes: 2 additions & 0 deletions tests/mutex/TransactionalMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public function testInvalidErrorMode(int $mode): void

/**
* Returns test cases for testInvalidErrorMode().
*
* @return iterable<list<mixed>>
*/
public static function provideInvalidErrorModeCases(): iterable
{
Expand Down

0 comments on commit 7942bf1

Please sign in to comment.