Skip to content

Commit

Permalink
static prov
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Dec 3, 2024
1 parent c344f89 commit a5a4752
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
'increment_style' => false,
'native_constant_invocation' => false,
'no_useless_else' => false,
'php_unit_data_provider_static' => false,
'php_unit_strict' => false,
'phpdoc_to_comment' => false,
'static_lambda' => false,
Expand Down
2 changes: 1 addition & 1 deletion tests/mutex/FlockMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function () {
}
}

public function dpTimeoutableStrategiesCases(): iterable
public static function dpTimeoutableStrategiesCases(): iterable
{
return [
[FlockMutex::STRATEGY_PCNTL],
Expand Down
4 changes: 2 additions & 2 deletions tests/mutex/MutexConcurrencyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testHighContention(callable $code, callable $mutexFactory)
/**
* Returns test cases for testHighContention().
*/
public function provideHighContentionCases(): iterable
public static function provideHighContentionCases(): iterable
{
$cases = array_map(function (array $mutexFactory): array {
$filename = tempnam(sys_get_temp_dir(), 'php-lock-high-contention');
Expand Down Expand Up @@ -219,7 +219,7 @@ public function testExecutionIsSerializedWhenLocked(callable $mutexFactory)
*
* @return callable[][] the mutex factories
*/
public function provideExecutionIsSerializedWhenLockedCases(): iterable
public static function provideExecutionIsSerializedWhenLockedCases(): iterable
{
$filename = tempnam(sys_get_temp_dir(), 'mutex-concurrency-test');

Expand Down
2 changes: 1 addition & 1 deletion tests/mutex/MutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function setUpBeforeClass(): void
*
* @return callable[][] the mutex factories
*/
public function provideMutexFactoriesCases(): iterable
public static function provideMutexFactoriesCases(): iterable
{
$cases = [
'NoMutex' => [function (): Mutex {
Expand Down
2 changes: 1 addition & 1 deletion tests/mutex/PHPRedisMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function testResistantToPartialClusterFailuresForReleasingLock()
}));
}

public function provideSerializersAndCompressorsCases(): iterable
public static function provideSerializersAndCompressorsCases(): iterable
{
if (!class_exists(Redis::class)) {
return [];
Expand Down
6 changes: 3 additions & 3 deletions tests/mutex/RedisMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function testTimingOut(int $count, float $timeout, float $delay)
*
* @return array test cases
*/
public function provideTimingOutCases(): iterable
public static function provideTimingOutCases(): iterable
{
// count, timeout, delay
return [
Expand Down Expand Up @@ -300,7 +300,7 @@ function () use (&$i, $available): bool {
*
* @return int[][] test cases
*/
public function provideMinorityCases(): iterable
public static function provideMinorityCases(): iterable
{
// total count, available count
return [
Expand All @@ -320,7 +320,7 @@ public function provideMinorityCases(): iterable
*
* @return int[][] test cases
*/
public function provideMajorityCases(): iterable
public static function provideMajorityCases(): iterable
{
// total count, available count
return [
Expand Down
4 changes: 2 additions & 2 deletions tests/mutex/TransactionalMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function testInvalidErrorMode(int $mode)
/**
* Returns test cases for testInvalidErrorMode().
*/
public function provideInvalidErrorModeCases(): iterable
public static function provideInvalidErrorModeCases(): iterable
{
return [
[\PDO::ERRMODE_SILENT],
Expand Down Expand Up @@ -147,7 +147,7 @@ public function testReplayTransaction(\Exception $exception)
*
* @return \Exception[][] test cases
*/
public function provideReplayTransactionCases(): iterable
public static function provideReplayTransactionCases(): iterable
{
return [
[new \PDOException()],
Expand Down
2 changes: 1 addition & 1 deletion tests/util/DoubleCheckedLockingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function testCodeNotExecuted(callable $check)
*
* @return callable[][] the test cases
*/
public function provideCodeNotExecutedCases(): iterable
public static function provideCodeNotExecutedCases(): iterable
{
$checkCounter = 0;

Expand Down

0 comments on commit a5a4752

Please sign in to comment.