Skip to content

Commit baf79df

Browse files
authored
Merge pull request #9770 from codeigniter4/dependabot/composer/rector/rector-2.2.5
chore(deps-dev): update rector/rector requirement from 2.2.4 to 2.2.5
2 parents 6a2885d + 4dbbb00 commit baf79df

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"phpunit/phpcov": "^9.0.2 || ^10.0",
2929
"phpunit/phpunit": "^10.5.16 || ^11.2",
3030
"predis/predis": "^3.0",
31-
"rector/rector": "2.2.4",
31+
"rector/rector": "2.2.5",
3232
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
3333
},
3434
"replace": {

rector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
3737
use Rector\PHPUnit\CodeQuality\Rector\Class_\RemoveDataProviderParamKeysRector;
3838
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
39+
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
3940
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
4041
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
4142
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
@@ -172,6 +173,11 @@
172173

173174
// needs separate PR for activation to allow more depth review
174175
FunctionLikeToFirstClassCallableRector::class,
176+
177+
AssertFuncCallToPHPUnitAssertRector::class => [
178+
// use $this inside static closure
179+
__DIR__ . '/tests/system/AutoReview/FrameworkCodeTest.php',
180+
],
175181
])
176182
// auto import fully qualified class names
177183
->withImportNames(removeUnusedImports: true)

system/Router/RouteCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ private function checkHostname($hostname): bool
15741574

15751575
// Has multiple hostnames
15761576
if (is_array($hostname)) {
1577-
$hostnameLower = array_map('strtolower', $hostname);
1577+
$hostnameLower = array_map(strtolower(...), $hostname);
15781578

15791579
return in_array(strtolower($this->httpHost), $hostnameLower, true);
15801580
}

tests/system/CommonSingleServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function testSingleServiceWithNoParamsSupplied(string $service): void
3737
$service1 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod
3838
$service2 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod
3939

40-
assert($service1 !== null);
40+
$this->assertNotNull($service1);
4141

4242
$this->assertInstanceOf($service1::class, $service2);
4343
$this->assertNotSame($service1, $service2);
@@ -65,7 +65,7 @@ public function testSingleServiceWithAtLeastOneParamSupplied(string $service): v
6565
$service1 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
6666
$service2 = single_service($service, ...$params); // @phpstan-ignore codeigniter.unknownServiceMethod
6767

68-
assert($service1 !== null);
68+
$this->assertNotNull($service1);
6969

7070
$this->assertInstanceOf($service1::class, $service2);
7171
$this->assertNotSame($service1, $service2);
@@ -120,8 +120,8 @@ public function testSingleServiceWithAllParamsSupplied(): void
120120
$cache1 = single_service('cache', null, true);
121121
$cache2 = single_service('cache', null, true);
122122

123-
assert($cache1 !== null);
124-
assert($cache2 !== null);
123+
$this->assertNotNull($cache1);
124+
$this->assertNotNull($cache2);
125125

126126
// Assert that even passing true as last param this will
127127
// not create a shared instance.

0 commit comments

Comments
 (0)