Skip to content

Commit bebbafc

Browse files
committed
Run Rector
1 parent 321ebdb commit bebbafc

7 files changed

Lines changed: 25 additions & 8 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"phake/phake": "^4.6",
2222
"phpunit/phpunit": "^12.3",
2323
"symfony/process": "^7.3",
24-
"phpstan/phpstan": "^2.1"
24+
"phpstan/phpstan": "^2.1",
25+
"rector/rector": "^2.1"
2526
},
2627
"replace": {
2728
"easywelfare/onebip-concurrency": "self.version",

rector.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
7+
return RectorConfig::configure()
8+
->withPaths([
9+
__DIR__ . '/src',
10+
__DIR__ . '/tests',
11+
])
12+
// uncomment to reach your current PHP version
13+
// ->withPhpSets()
14+
->withTypeCoverageLevel(0)
15+
->withDeadCodeLevel(0)
16+
->withCodeQualityLevel(0);

src/Recruiter/Concurrency/Timeout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private function __construct($microseconds, $waitingFor)
3030
{
3131
$this->maximum = $microseconds;
3232
$this->waitingFor = $waitingFor;
33-
$this->afterCheck = function () {
33+
$this->afterCheck = function (): void {
3434
};
3535
}
3636

tests/Recruiter/Concurrency/InProcessRetryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function setUp(): void
2525

2626
private function exceptionalCounterFactory(string $exceptionClass): \Closure
2727
{
28-
return function () use ($exceptionClass) {
28+
return function () use ($exceptionClass): void {
2929
++$this->count;
3030
throw new $exceptionClass();
3131
};

tests/Recruiter/Concurrency/MongoLockTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected function setUp(): void
3030
$this->clock = \Phake::mock(Clock::class);
3131

3232
$this->slept = [];
33-
$this->sleep = function ($amount) {
33+
$this->sleep = function ($amount): void {
3434
$this->slept[] = $amount;
3535
};
3636
}
@@ -289,7 +289,7 @@ public function testPropertyBased()
289289

290290
return true;
291291
})
292-
->then(function ($sequencesOfSteps) {
292+
->then(function ($sequencesOfSteps): void {
293293
$this->lockCollection->drop();
294294
$log = "/tmp/mongolock_{$this->iteration}.log";
295295
if (file_exists($log)) {

tests/Recruiter/Concurrency/PeriodicalCheckTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ public function testDoesNotPerformTheCheckTooManyTimes()
2727
),
2828
)
2929
// ->hook(Listener\collectFrequencies())
30-
->then(function ($startingDate, $period, $deltas) {
30+
->then(function ($startingDate, $period, $deltas): void {
3131
$clock = new SettableClock($startingDate);
3232
$check = PeriodicalCheck::every($period, $clock);
3333
$this->counter = 0;
34-
$check->onFire(function () {
34+
$check->onFire(function (): void {
3535
++$this->counter;
3636
});
3737
$check->__invoke();

tests/Recruiter/Concurrency/mongolock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
$uri = getenv('MONGODB_URI') ?: null;
2323
$lockCollection = new MongoDB\Client($uri)->selectCollection('concurrency-test', 'lock');
2424
$lock = new MongoLock($lockCollection, 'ilium_gate', $name);
25-
$log = function ($data) {
25+
$log = function ($data): void {
2626
fputcsv(
2727
STDOUT,
2828
array_merge(

0 commit comments

Comments
 (0)