Skip to content

Add rule that disallows final private methods#1490

Merged
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
herndlm:feature-7507
Jul 10, 2022
Merged

Add rule that disallows final private methods#1490
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
herndlm:feature-7507

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Jul 1, 2022

Closes phpstan/phpstan#7507

Refs: https://wiki.php.net/rfc/inheritance_private_methods

Is this going in the right direction? I'm unsure about a few details, e.g.

  • is bleeding edge needed?
  • is the php version check needed?
  • is it ok to be ignorable? (it's "only" a warning after all)

@ondrejmirtes ondrejmirtes marked this pull request as ready for review July 10, 2022 12:37
@ondrejmirtes ondrejmirtes merged commit 6e2e26b into phpstan:1.8.x Jul 10, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you! I took the liberty to mark it as ready and merge it :)

About your questions - you made everything correct in your PR :) The ignorability is questionable, I'm 50-50 in this case.

@herndlm
Copy link
Copy Markdown
Contributor Author

herndlm commented Jul 10, 2022

Oh, he's back :)
OK perfect, thx!

@ondrejmirtes
Copy link
Copy Markdown
Member

Oh yes, I was on vacation and I have some more vacations planned this summer, so there are gonna be a few more breaks from processing the inbox :) The work breaks are nice but I'm gonna start missing the work eventually I think :)

@ondrejmirtes
Copy link
Copy Markdown
Member

I also wanted to tag PHPStan 1.8.1 on July 1st before leaving, but I couldn't crack a bug I introduced so I hope I'll be able to solve it now that I'm recharged :)

@herndlm herndlm deleted the feature-7507 branch July 10, 2022 13:02
@ondrejmirtes
Copy link
Copy Markdown
Member

Oh, I have an immediate bug report for you :) This doesn't apply to constructors so it shouldn't be reported for them: https://3v4l.org/qZkFv

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.

declaring private methods final should emit level 0 error

2 participants