Skip to content

Parent constant visibility when it is declared in a super-superclass#1884

Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom
scheb:const-parent-visibility-2
Aug 21, 2019
Merged

Parent constant visibility when it is declared in a super-superclass#1884
TomasVotruba merged 1 commit intorectorphp:masterfrom
scheb:const-parent-visibility-2

Conversation

@scheb
Copy link
Copy Markdown
Contributor

@scheb scheb commented Aug 21, 2019

After my recent improvements on the PrivatizeLocalClassConstantRector, I've executed it on our big PHP project. Found out that the parent constant visibility is not detected correctly, when the constant is declared in the parent's parent or futher up the class hierarchy. This PR fixes the issue.

Worth mentioning: I've executed it on a project with 50k PHP files, did an almost perfect job. This issue was only a handful of cases. So 👍 for rector!

@TomasVotruba
Copy link
Copy Markdown
Member

I've executed it on a project with 50k PHP files, did an almost perfect job.

50 K php file? Not 50 k lines? Wow, how much loc is it? :D

Thanks for trying it out, this is very important on real huge projects. So I'm happy Rector did good job - also thanks to your contributoins 👍

Comment thread test.php Outdated
@scheb
Copy link
Copy Markdown
Contributor Author

scheb commented Aug 21, 2019

Wow, how much loc is it? :D

Non-Comment Lines of Code (NCLOC)            1661434
Class Constants                                20129

🙈

@TomasVotruba TomasVotruba merged commit 3a86093 into rectorphp:master Aug 21, 2019
@TomasVotruba
Copy link
Copy Markdown
Member

That's huge 😮

TomasVotruba added a commit that referenced this pull request Mar 1, 2022
rectorphp/rector-src@10de06f [DeadCode] Skip RemoveUnusedVariableAssignRector on assign to dynamic variable (#1884)
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