Uh oh!
There was an error while loading. Please reload this page.
refactor: add declare(strict_types=1) - #8072
Conversation
kenjis
commented
Oct 22, 2023
@samsonasik --- a/rector.php+++ b/rector.php@@ -44,6 +44,7 @@ use Rector\Privatization\Rector\Property\PrivatizeFinalClassPropertyRector;
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;
@@ -107,6 +108,15 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/system/Session/Handlers',
],
+ DeclareStrictTypesRector::class => [+ __DIR__ . '/app',+ __DIR__ . '/system/Commands/Generators/Views',+ __DIR__ . '/system/Pager/Views',+ __DIR__ . '/system/Validation/Views',+ __DIR__ . '/system/View/Parser.php',+ __DIR__ . '/tests/system/View/Views',+ ],+
// use mt_rand instead of random_int on purpose on non-cryptographically random
RandomFunctionRector::class,
@@ -117,6 +127,7 @@ return static function (RectorConfig $rectorConfig): void {
$rectorConfig->importNames();
$rectorConfig->removeUnusedImports();
+ $rectorConfig->rule(DeclareStrictTypesRector::class);
$rectorConfig->rule(UnderscoreToCamelCaseVariableNameRector::class);
$rectorConfig->rule(SimplifyUselessVariableRector::class);
$rectorConfig->rule(RemoveAlwaysElseRector::class); |
samsonasik
commented
Oct 22, 2023
I am on mobile, but that seems a bug due to |
samsonasik
commented
Oct 22, 2023
MGatner
commented
Oct 22, 2023
What a long-standing conversation! I think this is the right time to do this. @lonnieezell What was our |
MGatner
commented
Oct 22, 2023
909e7b7 to
94c109aCompareneznaika0
commented
Oct 23, 2023
I like type control. |
👋 Hi, @kenjis! |
94c109a to
e7323f3Compare👋 Hi, @kenjis! |
7c9cf1e to
55d04f7Compare60d3980 to
3b31066Compare👋 Hi, @kenjis! |
3b31066 to
d0b3895Compare👋 Hi, @kenjis! |
e1fb8f4 to
25e70ccCompare25e70cc to
dd84a82Comparedd84a82 to
3dfb298Compare9a4da43 to
71e8443Compare71e8443 to
4b87253Compare4b87253 to
528512dComparekenjis
commented
Nov 30, 2023
All checks have passed! 🎉 |
kenjis
commented
Dec 4, 2023
Now in |
Needs
#8078, #8080, #8090, #8091, #8124, #8138, #8175, #8242, #8270Description
declare(strict_types=1)Checklist: