Skip to content

Conversation

ruudk
Copy link
Contributor

@ruudk ruudk commented Feb 17, 2021

Fixes #5596

@ruudk
Copy link
Contributor Author

ruudk commented Feb 17, 2021

Can we somehow prevent this from happening again? Because nobody thinks about prefixing when contributing new rectors.

@TomasVotruba
Copy link
Member

Thanks 👍

The first choice would be PHPStan rule

@TomasVotruba TomasVotruba merged commit 73bdede into rectorphp:master Feb 17, 2021
@ruudk ruudk deleted the FullyQualified branch February 17, 2021 13:58
@ruudk
Copy link
Contributor Author

ruudk commented Feb 17, 2021

Do you know if there is such a rule?

@TomasVotruba
Copy link
Member

If it would, I'd look for it here: https://github.com/symplify/phpstan-rules/blob/master/docs/rules_overview.md

There is similar for method calls: https://github.com/symplify/phpstan-rules/blob/master/docs/rules_overview.md#requirestringargumentinmethodcallrule

It can be duplicated and instead of MethodCall the New_ node should be used.

ruudk added a commit to ruudk/symplify that referenced this pull request Feb 17, 2021
This can be used in Rector to prevent issues with prefixing.

See rectorphp/rector#5596 and rectorphp/rector#5597
ruudk added a commit to ruudk/symplify that referenced this pull request Feb 18, 2021
This can be used in Rector to prevent issues with prefixing.

See rectorphp/rector#5596 and rectorphp/rector#5597
TomasVotruba added a commit that referenced this pull request Feb 10, 2024
rectorphp/rector-src@6d408f5 [Performance] Use strlen() early before loop on VendorMissAnalyseGuard (#5597)
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.

InitializeDefaultEntityCollectionRector suggests \RectorPrefix20210215\Doctrine\Common\Collections\ArrayCollection
2 participants