Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DX] Add default empty definition with add getRuleDefinition() method on AbstractRector #6444

Closed
wants to merge 1 commit into from

Conversation

samsonasik
Copy link
Member

Ref #6438 (review)

This avoid tricky patch via scoper, allow user to add whenever they want, or not if they don't want to, eg, when updating for laravel package, it required to show on our website.

see, tricky patch on website rectorphp/getrector-com@a4b9dee

@samsonasik samsonasik changed the title [DX] Add default empty definition on getRuleDefinition() method on AbstractRector [DX] Add default empty definition with add getRuleDefinition() method on AbstractRector Nov 16, 2024
@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

Comment on lines +123 to +127
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition('', []);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll still need a way to enforce adding this method in our rules. This would let it silently pass

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I can add condition check for it :)

@TomasVotruba
Copy link
Member

This definition is desired for our rules only, so it should not exist outside deployed rector/rector.

@TomasVotruba
Copy link
Member

We can handle the edge-case in our website. That's the only place where this method is required. Let's keep it is 👍

@samsonasik samsonasik deleted the add-default-empty branch November 16, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants