Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add DeclareStrictTypesRector
Browse files Browse the repository at this point in the history
kenjis committed Nov 8, 2023

Verified

This commit was signed with the committer’s verified signature.
kenjis kenjis
1 parent d673dca commit 0cb90d8
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
@@ -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);

0 comments on commit 0cb90d8

Please sign in to comment.