Skip to content

Commit b74136e

Browse files
committed
refactor: enable AddMethodCallBasedStrictParamTypeRector
1 parent 655bd1d commit b74136e

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
5151
use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector;
5252
use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector;
53+
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
5354
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
5455
use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector;
5556
use Rector\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector;
@@ -213,6 +214,7 @@
213214
ExplicitBoolCompareRector::class,
214215
AddClosureVoidReturnTypeWhereNoReturnRector::class,
215216
AddFunctionVoidReturnTypeWhereNoReturnRector::class,
217+
AddMethodCallBasedStrictParamTypeRector::class,
216218
])
217219
->withConfiguredRule(StringClassNameToClassConstantRector::class, [
218220
// keep '\\' prefix string on string '\Foo\Bar'

system/Database/Postgre/Builder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ static function ($key, $value) use ($table, $alias, $that) {
411411
* Returns cast expression.
412412
*
413413
* @TODO move this to BaseBuilder in 4.5.0
414-
*
415-
* @param float|int|string $expression
416414
*/
417-
private function cast($expression, ?string $type): string
415+
private function cast(string $expression, ?string $type): string
418416
{
419417
return ($type === null) ? $expression : 'CAST(' . $expression . ' AS ' . strtoupper($type) . ')';
420418
}

tests/system/API/ResponseTraitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ public function testValidContentTypes(): void
574574
}
575575
}
576576

577-
private function tryValidContentType($mimeType, $contentType): void
577+
private function tryValidContentType(string $mimeType, string $contentType): void
578578
{
579579
$original = $_SERVER;
580580
$_SERVER['CONTENT_TYPE'] = $mimeType;

tests/system/Router/AutoRouterImprovedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function setUp(): void
4545
$this->collection = new RouteCollection(Services::locator(), $moduleConfig, new Routing());
4646
}
4747

48-
private function createNewAutoRouter($namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved
48+
private function createNewAutoRouter(string $namespace = 'CodeIgniter\Router\Controllers'): AutoRouterImproved
4949
{
5050
return new AutoRouterImproved(
5151
[],

tests/system/Test/BootstrapFCPATHTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function fileContents()
102102
return $fileContents . ('echo FCPATH;' . PHP_EOL);
103103
}
104104

105-
private function readOutput($file)
105+
private function readOutput(string $file)
106106
{
107107
ob_start();
108108
system('php -f ' . $file);

0 commit comments

Comments
 (0)