withPhpSets(php81: true) ->withPreparedSets(deadCode: true, codeQuality: true) ->withComposerBased(phpunit: true) ->withParallel(120, 8, 10) ->withCache( is_dir('/tmp') ? '/tmp/rector' : null, FileCacheStorage::class, ) ->withPaths([ __DIR__ . '/src', ]) ->withAutoloadPaths([ __DIR__ . '/vendor/autoload.php', ]) ->withBootstrapFiles([ __DIR__ . '/vendor/codeigniter4/framework/system/Test/bootstrap.php', ]) ->withPHPStanConfigs([ __DIR__ . '/phpstan.neon.dist', ]) ->withImportNames(removeUnusedImports: true) ->withSkip([ StringifyStrNeedlesRector::class, RemoveUnusedPromotedPropertyRector::class, // Note: requires php 8 ]) ->withRules([ ChangeIfElseValueAssignToEarlyReturnRector::class, ChangeNestedForeachIfsToEarlyContinueRector::class, CountArrayToEmptyArrayComparisonRector::class, DisallowedEmptyRuleFixerRector::class, EmptyOnNullableObjectToInstanceOfRector::class, FuncGetArgsToVariadicParamRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, PreparedValueToEarlyReturnRector::class, PrivatizeFinalClassPropertyRector::class, RemoveAlwaysElseRector::class, SimplifyUselessVariableRector::class, StringClassNameToClassConstantRector::class, VersionCompareFuncCallToConstantRector::class, ]) ->withConfiguredRule(TypedPropertyFromAssignsRector::class, [ // Allow public property inlining when BC breaks are acceptable. TypedPropertyFromAssignsRector::INLINE_PUBLIC => true, ]);