Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phpunit/phpcov": "^9.0.2 || ^10.0",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^3.0",
"rector/rector": "2.2.4",
"rector/rector": "2.2.5",
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
},
"replace": {
Expand Down
6 changes: 6 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\RemoveDataProviderParamKeysRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
Expand Down Expand Up @@ -172,6 +173,11 @@

// needs separate PR for activation to allow more depth review
FunctionLikeToFirstClassCallableRector::class,

AssertFuncCallToPHPUnitAssertRector::class => [
// use $this inside static closure
__DIR__ . '/tests/system/AutoReview/FrameworkCodeTest.php',
],
])
// auto import fully qualified class names
->withImportNames(removeUnusedImports: true)
Expand Down
2 changes: 1 addition & 1 deletion system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ private function checkHostname($hostname): bool

// Has multiple hostnames
if (is_array($hostname)) {
$hostnameLower = array_map('strtolower', $hostname);
$hostnameLower = array_map(strtolower(...), $hostname);

return in_array(strtolower($this->httpHost), $hostnameLower, true);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/system/CommonSingleServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testSingleServiceWithNoParamsSupplied(string $service): void
$service1 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod
$service2 = single_service($service); // @phpstan-ignore codeigniter.unknownServiceMethod

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

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

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

$this->assertInstanceOf($service1::class, $service2);
$this->assertNotSame($service1, $service2);
Expand Down Expand Up @@ -120,8 +120,8 @@ public function testSingleServiceWithAllParamsSupplied(): void
$cache1 = single_service('cache', null, true);
$cache2 = single_service('cache', null, true);

assert($cache1 !== null);
assert($cache2 !== null);
$this->assertNotNull($cache1);
$this->assertNotNull($cache2);

// Assert that even passing true as last param this will
// not create a shared instance.
Expand Down
Loading