clean up rector config

This commit is contained in:
lubiana 2024-02-03 10:58:53 +01:00
parent 8c90c27762
commit 894d6ec850
2 changed files with 9 additions and 3 deletions

View file

@ -19,7 +19,7 @@
} }
}, },
"scripts": { "scripts": {
"fix": [ "lint": [
"rector", "rector",
"ecs --fix", "ecs --fix",
"ecs --fix" "ecs --fix"

View file

@ -24,7 +24,6 @@ use Rector\EarlyReturn\Rector\Return_\PreparedValueToEarlyReturnRector;
use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector;
use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector; use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector;
use Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector; use Rector\Php80\Rector\ClassConstFetch\ClassOnThisVariableObjectRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector; use Rector\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeFromPropertyTypeRector;
@ -44,7 +43,14 @@ use Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYield
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector;
return RectorConfig::configure() return RectorConfig::configure()
->withSets([LevelSetList::UP_TO_PHP_83]) ->withPhpSets(php83: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
typeDeclarations: true,
earlyReturn: true,
strictBooleans: true,
)
->withRules([ ->withRules([
AddArrowFunctionReturnTypeRector::class, AddArrowFunctionReturnTypeRector::class,
AddMethodCallBasedStrictParamTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class,