Skip to content
Open
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 @@ -29,7 +29,7 @@
"phpunit/phpcov": "^9.0.2 || ^10.0",
"phpunit/phpunit": "^10.5.16 || ^11.2",
"predis/predis": "^3.0",
"rector/rector": "2.5.8",
"rector/rector": "2.5.9",
"shipmonk/phpstan-baseline-per-identifier": "^2.0"
},
"replace": {
Expand Down
18 changes: 0 additions & 18 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
use Rector\Php70\Rector\FuncCall\RandomFunctionRector;
use Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector;
use Rector\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector;
use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\CodeQuality\Rector\Class_\YieldDataProviderRector;
use Rector\PHPUnit\CodeQuality\Rector\FuncCall\AssertFuncCallToPHPUnitAssertRector;
use Rector\PHPUnit\CodeQuality\Rector\StmtsAwareInterface\DeclareStrictTypesTestsRector;
use Rector\Privatization\Rector\Class_\FinalizeTestCaseClassRector;
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
Expand Down Expand Up @@ -107,13 +104,6 @@
// Keep property defaults for backward compatibility.
RemoveDefaultValueFromAssignedPropertyRector::class,

ReadOnlyPropertyRector::class => [
__DIR__ . '/system/Cache/ResponseCache.php',
__DIR__ . '/system/HotReloader/IteratorFilter.php',
__DIR__ . '/system/Router/RouteCollection.php',
__DIR__ . '/system/Security/Security.php',
],

// Exclude test file because `is_cli()` is mocked and Rector might remove needed parameters.
RemoveExtraParametersRector::class => [
__DIR__ . '/tests/system/Debug/ToolbarTest.php',
Expand Down Expand Up @@ -160,19 +150,11 @@
__DIR__ . '/system/HTTP/SiteURI.php',
],

// Unnecessary (string) is inserted
NullToStrictStringFuncCallArgRector::class,

CompactToVariablesRector::class,

// possibly isset() on purpose, on updated Config classes property across versions
IssetOnPropertyObjectToPropertyExistsRector::class,

AssertFuncCallToPHPUnitAssertRector::class => [
// use $this inside static closure
__DIR__ . '/tests/system/AutoReview/FrameworkCodeTest.php',
],

// some tests extended by other tests
FinalizeTestCaseClassRector::class,

Expand Down
6 changes: 3 additions & 3 deletions system/Router/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ private function isValidSegment(string $segment): bool
* Takes an array of URI segments as input and sets the class/method
* to be called.
*
* @param array $segments URI segments
* @param list<string> $segments URI segments
*
* @return void
*/
Expand All @@ -705,13 +705,13 @@ protected function setRequest(array $segments = [])
return;
}

[$controller, $method] = array_pad(explode('::', $segments[0]), 2, null);
[$controller, $method] = explode('::', $segments[0], 2) + [null, null];

$this->controller = $controller;

// $this->method already contains the default method name,
// so don't overwrite it with emptiness.
if (! empty($method)) {
if ($method !== null && $method !== '') {
$this->method = $method;
}

Expand Down
4 changes: 2 additions & 2 deletions utils/phpstan-baseline/empty.notAllowed.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 205 errors
# total 204 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -279,7 +279,7 @@ parameters:

-
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
count: 2
count: 1
path: ../../system/Router/Router.php

-
Expand Down
2 changes: 1 addition & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1810 errors
# total 1808 errors

includes:
- argument.type.neon
Expand Down
7 changes: 1 addition & 6 deletions utils/phpstan-baseline/missingType.iterableValue.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 1140 errors
# total 1139 errors

parameters:
ignoreErrors:
Expand Down Expand Up @@ -3637,11 +3637,6 @@ parameters:
count: 1
path: ../../system/Router/Router.php

-
message: '#^Method CodeIgniter\\Router\\Router\:\:setRequest\(\) has parameter \$segments with no value type specified in iterable type array\.$#'
count: 1
path: ../../system/Router/Router.php

-
message: '#^Method CodeIgniter\\Router\\Router\:\:validateRequest\(\) has parameter \$segments with no value type specified in iterable type array\.$#'
count: 1
Expand Down
Loading