Last active
April 14, 2023 12:29
-
-
Save u01jmg3/d73cd0ebcb435ee1c90f0d1a139c9fba to your computer and use it in GitHub Desktop.
Revisions
-
u01jmg3 revised this gist
Mar 10, 2022 . 2 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -61,10 +61,10 @@ Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class, Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class, Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 @@ -80,7 +80,7 @@ Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector::class, Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class, // PHP 8 // Paths 'application\views\templates', ]); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -52,10 +52,10 @@ Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class, Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class, Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 @@ -71,7 +71,7 @@ Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector::class, Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class, // PHP 8 // Paths 'app\Console\Kernel.php', 'app\Exceptions\Handler.php', -
u01jmg3 revised this gist
Mar 9, 2022 . 2 changed files with 0 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -48,11 +48,8 @@ Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class, Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class, Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class, Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,11 +39,8 @@ Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class, Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class, Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class, Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, -
u01jmg3 revised this gist
Mar 8, 2022 . 2 changed files with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,8 +53,6 @@ Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -44,8 +44,6 @@ Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, -
u01jmg3 revised this gist
Mar 8, 2022 . 2 changed files with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -75,9 +75,11 @@ Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\BooleanOr\IsIterableRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BooleanOr\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -66,9 +66,11 @@ Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\BooleanOr\IsIterableRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BooleanOr\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, -
u01jmg3 revised this gist
Mar 8, 2022 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -69,6 +69,7 @@ Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -60,6 +60,7 @@ Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\CodingStyle\Rector\ClassConst\RemoveFinalFromConstRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 -
u01jmg3 revised this gist
Mar 8, 2022 . 2 changed files with 3 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,7 +26,7 @@ 'application/libraries', 'application/migrations', 'application/models', 'rector.php', # Create from `src/index.php` without the code for configuring environments ]); $parameters->set(Option::SKIP, [ @@ -55,7 +55,6 @@ Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Naming\Rector\Property\UnderscoreToCamelCasePropertyNameRector::class, Rector\Naming\Rector\Variable\UnderscoreToCamelCaseVariableNameRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, @@ -70,15 +69,14 @@ Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, @@ -102,7 +100,6 @@ $containerConfigurator->import(SetList::CODE_QUALITY); $containerConfigurator->import(SetList::CODING_STYLE); $containerConfigurator->import(SetList::DEAD_CODE); $containerConfigurator->import(SetList::PHP_70); $containerConfigurator->import(SetList::PHP_71); $containerConfigurator->import(SetList::PHP_72); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,6 @@ Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Naming\Rector\Property\UnderscoreToCamelCasePropertyNameRector::class, Rector\Naming\Rector\Variable\UnderscoreToCamelCaseVariableNameRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, @@ -61,15 +60,14 @@ Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, Rector\Transform\Rector\String_\StringToClassConstantRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, @@ -109,7 +107,6 @@ $containerConfigurator->import(LaravelSetList::LARAVEL_52); $containerConfigurator->import(LaravelSetList::LARAVEL_53); $containerConfigurator->import(LaravelSetList::LARAVEL_54); $containerConfigurator->import(SetList::PHP_70); $containerConfigurator->import(SetList::PHP_71); $containerConfigurator->import(SetList::PHP_72); -
u01jmg3 revised this gist
Mar 8, 2022 . 2 changed files with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -80,7 +80,6 @@ Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BinaryOp\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -71,7 +71,6 @@ Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BinaryOp\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, -
u01jmg3 revised this gist
Mar 8, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,6 @@ use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Php53\Rector\Ternary\TernaryToElvisRector; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; -
u01jmg3 revised this gist
Mar 8, 2022 . 4 changed files with 240 additions and 106 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,117 @@ <?php declare(strict_types=1); use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Laravel\Set\LaravelSetList; use Rector\Php53\Rector\Ternary\TernaryToElvisRector; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; // rector process application --config=rector-codeigniter.php return static function (ContainerConfigurator $containerConfigurator): void { $parameters = $containerConfigurator->parameters(); $parameters->set(Option::IMPORT_SHORT_CLASSES, false); $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_56); // PhpVersion::PHP_74 $parameters->set(Option::AUTOLOAD_PATHS, [ '../composer_plugins/autoload.php', # __DIR__ . '/vendor/autoload.php', 'system/core', 'system/libraries', 'application/core', 'application/controllers', 'application/libraries', 'application/migrations', 'application/models', 'rector.php', # Create from `src/index.php` without the code for configuring environments ]); $parameters->set(Option::SKIP, [ // Rectors Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class, Rector\CodeQuality\Rector\Concat\JoinStringConcatRector::class, Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class, Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class, Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector::class, Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class, Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class, Rector\CodeQuality\Rector\If_\CombineIfRector::class, Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class, Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector::class, Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class, Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class, Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector::class, Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector::class, Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class, Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class, Rector\CodingStyle\Rector\Function_\CamelCaseFunctionNamingToUnderscoreRector::class, Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class, Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Naming\Rector\Property\UnderscoreToCamelCasePropertyNameRector::class, Rector\Naming\Rector\Variable\UnderscoreToCamelCaseVariableNameRector::class, Rector\Php56\Rector\FuncCall\PowToExpRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, Rector\Php71\Rector\FuncCall\CountOnNullRector::class, Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class, Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class, Rector\Php74\Rector\Property\TypedPropertyRector::class, Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector::class, Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class, Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class, Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\BinaryOp\IsIterableRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BinaryOp\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class, // Paths 'application\views\templates', ]); $parameters->set(Option::PATHS, [ 'application\config', 'application\controllers', 'application\core', 'application\helpers', 'application\migrations', 'application\models', 'application\views', ]); $containerConfigurator->import(SetList::CODE_QUALITY); $containerConfigurator->import(SetList::CODING_STYLE); $containerConfigurator->import(SetList::DEAD_CODE); $containerConfigurator->import(SetList::PHP_56); $containerConfigurator->import(SetList::PHP_70); $containerConfigurator->import(SetList::PHP_71); $containerConfigurator->import(SetList::PHP_72); $containerConfigurator->import(SetList::PHP_73); $containerConfigurator->import(SetList::PHP_74); $services = $containerConfigurator->services(); $services->set(TernaryToElvisRector::class); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,52 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,123 @@ <?php declare(strict_types=1); use Rector\Core\Configuration\Option; use Rector\Core\ValueObject\PhpVersion; use Rector\Laravel\Set\LaravelSetList; use Rector\Php53\Rector\Ternary\TernaryToElvisRector; use Rector\Set\ValueObject\SetList; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; // rector process app --config=rector-laravel.php return static function (ContainerConfigurator $containerConfigurator): void { $parameters = $containerConfigurator->parameters(); $parameters->set(Option::IMPORT_SHORT_CLASSES, false); $parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_56); // PhpVersion::PHP_74 $parameters->set(Option::AUTOLOAD_PATHS, [__DIR__ . '/vendor/autoload.php']); $parameters->set(Option::SKIP, [ // Rectors Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class, Rector\CodeQuality\Rector\Concat\JoinStringConcatRector::class, Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class, Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class, Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector::class, Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class, Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class, Rector\CodeQuality\Rector\If_\CombineIfRector::class, Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class, Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector::class, Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class, Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class, Rector\CodeQuality\Rector\PropertyFetch\ExplicitMethodCallOverMagicGetSetRector::class, Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector::class, Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class, Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class, Rector\CodingStyle\Rector\Function_\CamelCaseFunctionNamingToUnderscoreRector::class, Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class, Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, Rector\Naming\Rector\Property\UnderscoreToCamelCasePropertyNameRector::class, Rector\Naming\Rector\Variable\UnderscoreToCamelCaseVariableNameRector::class, Rector\Php56\Rector\FuncCall\PowToExpRector::class, Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, Rector\Php71\Rector\FuncCall\CountOnNullRector::class, Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class, Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class, Rector\Php74\Rector\Property\TypedPropertyRector::class, Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector::class, Rector\CodingStyle\Rector\ClassMethod\UnSpreadOperatorRector::class, Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector::class, Rector\CodeQuality\Rector\ClassMethod\DateTimeToDateTimeInterfaceRector::class, Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector::class, Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector::class, // PHP 5.6 incompatible Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 Rector\Php70\Rector\If_\IfToSpaceshipRector::class, Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, Rector\Php71\Rector\BinaryOp\IsIterableRector::class, Rector\Php71\Rector\List_\ListToArrayDestructRector::class, Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, Rector\Php73\Rector\BinaryOp\IsCountableRector::class, Rector\Php74\Rector\Assign\NullCoalescingOperatorRector::class, Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector::class, Rector\Php74\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class, Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector::class, Rector\Php74\Rector\MethodCall\ChangeReflectionTypeToStringToGetNameRector::class, Rector\Php74\Rector\StaticCall\ExportToReflectionFunctionRector::class, Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector::class, // Paths 'app\Console\Kernel.php', 'app\Exceptions\Handler.php', 'app\Http\Kernel.php', ]); $parameters->set(Option::PATHS, [ 'app\Auth', 'app\Console', 'app\Events', 'app\Exceptions', 'app\Helpers', 'app\Http', 'app\Listeners', 'app\Mail', 'app\Models', 'app\Notifications', 'app\Observers', 'app\Providers', 'app\Repositories', 'app\Sanitizers', 'app\Services', 'app\Validators', ]); $containerConfigurator->import(SetList::CODE_QUALITY); $containerConfigurator->import(SetList::CODING_STYLE); $containerConfigurator->import(SetList::DEAD_CODE); $containerConfigurator->import(LaravelSetList::LARAVEL_50); $containerConfigurator->import(LaravelSetList::LARAVEL_51); $containerConfigurator->import(LaravelSetList::LARAVEL_52); $containerConfigurator->import(LaravelSetList::LARAVEL_53); $containerConfigurator->import(LaravelSetList::LARAVEL_54); $containerConfigurator->import(SetList::PHP_56); $containerConfigurator->import(SetList::PHP_70); $containerConfigurator->import(SetList::PHP_71); $containerConfigurator->import(SetList::PHP_72); $containerConfigurator->import(SetList::PHP_73); $containerConfigurator->import(SetList::PHP_74); $services = $containerConfigurator->services(); $services->set(TernaryToElvisRector::class); }; This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,54 +0,0 @@ -
u01jmg3 revised this gist
Jan 9, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ parameters: - 'application\libraries' - 'application\migrations' - 'application\models' - 'rector.php' # Create from `src\index.php` without the code for configuring environments exclude_rectors: - Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector - Rector\CodeQuality\Rector\Concat\JoinStringConcatRector -
u01jmg3 created this gist
Jan 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,52 @@ # rector process application --config=rector-codeigniter.yml parameters: import_short_classes: false php_version_features: '5.6' #'7.3' autoload_paths: - '..\composer_plugins\autoload.php' # '..\vendor\autoload.php' - 'system\core' - 'system\libraries' - 'application\core' - 'application\controllers' - 'application\libraries' - 'application\migrations' - 'application\models' - 'rector.php' exclude_rectors: - Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector - Rector\CodeQuality\Rector\Concat\JoinStringConcatRector - Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector - Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector - Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector - Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector - Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector - Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector - Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector - Rector\Php56\Rector\FuncCall\PowToExpRector - Rector\Php71\Rector\FuncCall\CountOnNullRector - Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector # PHP 5.6 incompatible - Rector\Php71\Rector\BinaryOp\IsIterableRector - Rector\Php71\Rector\List_\ListToArrayDestructRector - Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector - Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector - Rector\Php73\Rector\BinaryOp\IsCountableRector - Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector paths: - 'application\config' - 'application\controllers' - 'application\core' - 'application\helpers' - 'application\migrations' - 'application\models' - 'application\views' exclude_paths: - 'application\views\templates' sets: - 'code-quality' - 'dead-code' - 'laravel' - 'php56' - 'php71' - 'php72' - 'php73' This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ # rector process app --config=rector-laravel.yml parameters: import_short_classes: false php_version_features: '5.6' #'7.3' autoload_paths: - 'vendor\autoload.php' exclude_rectors: - Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector - Rector\CodeQuality\Rector\Concat\JoinStringConcatRector - Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector - Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector - Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector - Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector - Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector - Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector - Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector - Rector\Php56\Rector\FuncCall\PowToExpRector - Rector\Php71\Rector\FuncCall\CountOnNullRector - Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector # PHP 5.6 incompatible - Rector\Php71\Rector\BinaryOp\IsIterableRector - Rector\Php71\Rector\List_\ListToArrayDestructRector - Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector - Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector - Rector\Php73\Rector\BinaryOp\IsCountableRector - Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector paths: - 'app\Auth' - 'app\Console' - 'app\Events' - 'app\Exceptions' - 'app\Helpers' - 'app\Http' - 'app\Listeners' - 'app\Mail' - 'app\Models' - 'app\Notifications' - 'app\Providers' - 'app\Repositories' - 'app\Sanitizers' - 'app\Services' - 'app\Validators' exclude_paths: - 'app\Console\Kernel.php' - 'app\Exceptions\Handler.php' - 'app\Http\Kernel.php' sets: - 'code-quality' - 'dead-code' - 'laravel' - 'php56' - 'php71' - 'php72' - 'php73'