diff --git a/rector.php b/rector.php index d8ab56f3cc8e..e16de7bae441 100644 --- a/rector.php +++ b/rector.php @@ -50,6 +50,7 @@ use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector; use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector; +use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector; use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector; @@ -213,6 +214,7 @@ ExplicitBoolCompareRector::class, AddClosureVoidReturnTypeWhereNoReturnRector::class, AddFunctionVoidReturnTypeWhereNoReturnRector::class, + AddMethodCallBasedStrictParamTypeRector::class, ]) ->withConfiguredRule(StringClassNameToClassConstantRector::class, [ // keep '\\' prefix string on string '\Foo\Bar' diff --git a/system/Database/Postgre/Builder.php b/system/Database/Postgre/Builder.php index 1071dfedf06b..0d2dce0957ae 100644 --- a/system/Database/Postgre/Builder.php +++ b/system/Database/Postgre/Builder.php @@ -411,10 +411,8 @@ static function ($key, $value) use ($table, $alias, $that) { * Returns cast expression. * * @TODO move this to BaseBuilder in 4.5.0 - * - * @param float|int|string $expression */ - private function cast($expression, ?string $type): string + private function cast(string $expression, ?string $type): string { return ($type === null) ? $expression : 'CAST(' . $expression . ' AS ' . strtoupper($type) . ')'; } diff --git a/tests/system/API/ResponseTraitTest.php b/tests/system/API/ResponseTraitTest.php index 0887c673d616..82229b014bd4 100644 --- a/tests/system/API/ResponseTraitTest.php +++ b/tests/system/API/ResponseTraitTest.php @@ -574,7 +574,7 @@ public function testValidContentTypes(): void } } - private function tryValidContentType($mimeType, $contentType): void + private function tryValidContentType(string $mimeType, string $contentType): void { $original = $_SERVER; $_SERVER['CONTENT_TYPE'] = $mimeType; diff --git a/tests/system/Router/AutoRouterImprovedTest.php b/tests/system/Router/AutoRouterImprovedTest.php index 5975280bcdfd..0f4c75162a2f 100644 --- a/tests/system/Router/AutoRouterImprovedTest.php +++ b/tests/system/Router/AutoRouterImprovedTest.php @@ -45,7 +45,7 @@ protected function setUp(): void $this->collection = new RouteCollection(Services::locator(), $moduleConfig, new Routing()); } - private function createNewAutoRouter($namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved + private function createNewAutoRouter(string $namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved { return new AutoRouterImproved( [], diff --git a/tests/system/Test/BootstrapFCPATHTest.php b/tests/system/Test/BootstrapFCPATHTest.php index 61d2e1ca1695..d58bb847360d 100644 --- a/tests/system/Test/BootstrapFCPATHTest.php +++ b/tests/system/Test/BootstrapFCPATHTest.php @@ -102,7 +102,7 @@ private function fileContents() return $fileContents . ('echo FCPATH;' . PHP_EOL); } - private function readOutput($file) + private function readOutput(string $file) { ob_start(); system('php -f ' . $file);