Skip to content

Commit

Permalink
make rule configuration default to false to keep BC
Browse files Browse the repository at this point in the history
  • Loading branch information
canvural committed Oct 26, 2024
1 parent 4187297 commit 6d37120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ public function refactorWithScope(Node $node, Scope $scope): ?Node
*/
public function configure(array $configuration): void
{
if ($configuration === []) {
$this->shouldUseNewGenerics = false;

return;
}

Assert::count($configuration, 1);
Assert::keyExists($configuration, 'shouldUseNewGenerics');
Assert::boolean($configuration['shouldUseNewGenerics']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/../../../../../config/config.php');

$rectorConfig->ruleWithConfiguration(AddGenericReturnTypeToRelationsRector::class, [
'shouldUseNewGenerics' => false,
]);
$rectorConfig->ruleWithConfiguration(AddGenericReturnTypeToRelationsRector::class, []);
};

0 comments on commit 6d37120

Please sign in to comment.