From 0cb90d85cd623af8875f6c2757b2db091e2ee172 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 30 Oct 2023 12:58:52 +0900 Subject: [PATCH] chore: add DeclareStrictTypesRector --- rector.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rector.php b/rector.php index fbf0d3692fc0..7b4fbbf6dc68 100644 --- a/rector.php +++ b/rector.php @@ -45,6 +45,7 @@ use Rector\Set\ValueObject\LevelSetList; use Rector\Set\ValueObject\SetList; use Rector\Strict\Rector\If_\BooleanInIfConditionRuleFixerRector; +use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; use Utils\Rector\PassStrictParameterToFunctionParameterRector; use Utils\Rector\RemoveErrorSuppressInTryCatchStmtsRector; use Utils\Rector\RemoveVarTagFromClassConstantRector; @@ -109,6 +110,19 @@ __DIR__ . '/system/Session/Handlers', ], + DeclareStrictTypesRector::class => [ + __DIR__ . '/app', + __DIR__ . '/system/CodeIgniter.php', + __DIR__ . '/system/Config/BaseConfig.php', + __DIR__ . '/system/Commands/Generators/Views', + __DIR__ . '/system/Pager/Views', + __DIR__ . '/system/Test/ControllerTestTrait.php', + __DIR__ . '/system/Validation/Views', + __DIR__ . '/system/View/Parser.php', + __DIR__ . '/tests/system/Debug/ExceptionsTest.php', + __DIR__ . '/tests/system/View/Views', + ], + // use mt_rand instead of random_int on purpose on non-cryptographically random RandomFunctionRector::class, @@ -119,6 +133,7 @@ $rectorConfig->importNames(); $rectorConfig->removeUnusedImports(); + $rectorConfig->rule(DeclareStrictTypesRector::class); $rectorConfig->rule(UnderscoreToCamelCaseVariableNameRector::class); $rectorConfig->rule(SimplifyUselessVariableRector::class); $rectorConfig->rule(RemoveAlwaysElseRector::class);