How to rewrite the config #8654
-
Actually I have this config return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
...
]);
$rectorConfig->sets([
SetList::DEAD_CODE,
SetList::PHP_81,
PHPUnitSetList::PHPUNIT_100,
SetList::EARLY_RETURN,
]);
$rectorConfig->skip(
[
...
],
);
}; And I want to rewrite config to the newer format return RectorConfig::configure()
->withPaths([
...
])
->withPhpVersion(PhpVersion::PHP_81)
->withPreparedSets(deadCode: true, earlyReturn: true)
->withPhpSets(php81: true)
->withAttributesSets(phpunit: true)
->withSkip([...])
; How can I set the PHPUnitSet in the new format? |
Beta Was this translation helpful? Give feedback.
Answered by
samsonasik
May 24, 2024
Replies: 1 comment 1 reply
-
You can use return RectorConfig::configure()
->withPaths([
...
])
->withPhpVersion(PhpVersion::PHP_81)
->withPreparedSets(deadCode: true, earlyReturn: true)
->withPhpSets(php81: true)
->withSets(
[
PHPUnitSetList::PHPUNIT_100
]
)
->withSkip([...])
; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
samsonasik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use
withSets()
: