Skip to content

Commit

Permalink
chore: add DeclareStrictTypesRector
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 30, 2023
1 parent d7aa0d0 commit 3b31066
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -108,6 +109,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,

Expand All @@ -118,6 +132,7 @@
$rectorConfig->importNames();
$rectorConfig->removeUnusedImports();

$rectorConfig->rule(DeclareStrictTypesRector::class);
$rectorConfig->rule(UnderscoreToCamelCaseVariableNameRector::class);
$rectorConfig->rule(SimplifyUselessVariableRector::class);
$rectorConfig->rule(RemoveAlwaysElseRector::class);
Expand Down

0 comments on commit 3b31066

Please sign in to comment.