Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Transform] Transform rules() to withRules() on RectorConfigBuilderRe…
…ctor (#5566)
- Loading branch information
1 parent
09398c3
commit 9a44c19
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
...Rector/FileWithoutNamespace/RectorConfigBuilderRector/Fixture/rules_to_with_rules.php.inc
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Transform\Rector\FileWithoutNamespace\RectorConfigBuilderRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnUnionTypeRector; | ||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->rule(ReturnUnionTypeRector::class); | ||
$rectorConfig->rules([ | ||
RectorConfigBuilderRector::class, | ||
TypedPropertyFromAssignsRector::class | ||
]); | ||
}; | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
use Rector\Transform\Rector\FileWithoutNamespace\RectorConfigBuilderRector; | ||
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnUnionTypeRector; | ||
use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; | ||
|
||
return \Rector\Config\RectorConfig::configure()->withRules([ReturnUnionTypeRector::class, RectorConfigBuilderRector::class, TypedPropertyFromAssignsRector::class]); | ||
|
||
?> |
This file contains 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 characters