Skip to content

Instantly share code, notes, and snippets.

@u01jmg3
Last active April 14, 2023 12:29
Show Gist options
  • Save u01jmg3/d73cd0ebcb435ee1c90f0d1a139c9fba to your computer and use it in GitHub Desktop.
Save u01jmg3/d73cd0ebcb435ee1c90f0d1a139c9fba to your computer and use it in GitHub Desktop.
Rector configs
# 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'
# 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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment