-
Notifications
You must be signed in to change notification settings - Fork 84
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
[ErrorNamesPropertyToConstantRector] add new rule to fix #280 #372
[ErrorNamesPropertyToConstantRector] add new rule to fix #280 #372
Conversation
Im not sure what the best way to find if property |
*/ | ||
public function getNodeTypes(): array | ||
{ | ||
return [ClassConstFetch::class]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be PhpParser\Node\Expr\StaticPropertyFetch
?
I'd use |
361ebb8
to
09a1bec
Compare
@stefantalen thanks that was very helpful |
09a1bec
to
4fa223c
Compare
I dont know why https://github.com/rectorphp/rector-symfony/actions/runs/4281227323/jobs/7453990047 is failing. I did On the other hand the rector always fails with this message: |
Try |
4fa223c
to
546ad93
Compare
Yes thank you :) i now see i can also open the logs above. |
@samsonasik can you do a cr? |
We'll need a rebase here. |
if (! $classReflection->isSubclassOf('Symfony\Component\Validator\Constraint')) { | ||
return null; | ||
} | ||
if ($this->nodeNameResolver->getName($node->name) !== 'errorNames') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ($this->nodeNameResolver->getName($node->name) !== 'errorNames') { | |
if (! $this->nodeNameResolver->isName($node->name, 'errorNames')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's look very good!
Please rebase, fix one detail and ready to merge 👍
$parametersAcceptor = ParametersAcceptorSelector::selectSingle($extendedMethodReflection->getVariants()); | ||
$parametersAcceptorWithPhpDocs = ParametersAcceptorSelector::selectSingle( | ||
$extendedMethodReflection->getVariants() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use:
ParametersAcceptorSelector::combineAcceptors(
$extendedMethodReflection->getVariants())
That ensure multi variants is supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
546ad93
to
296d381
Compare
296d381
to
8255805
Compare
@TomasVotruba and @samsonasik made the requested changes and pipeline passes can you cr again |
Looks good to me 👍 @samsonasik Feel free to merge when ready for you 🙏 |
Thank you @johanadivare |
No description provided.