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

Implement AbstractPrivateMethodRule #2756

Merged
merged 3 commits into from
Nov 21, 2023
Merged

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Nov 21, 2023

Abstract function cannot be declared private

https://3v4l.org/9V2aN#veol


as a followup I would do similar stuff for interfaces: https://3v4l.org/3VBl2

Verified

This commit was signed with the committer’s verified signature.
axlon Choraimy Kroonstuiver
Copy link
Member

@ondrejmirtes ondrejmirtes left a comment

Choose a reason for hiding this comment

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

  1. This has to be allowed in traits
  2. Please test interfaces too

RuleErrorBuilder::message(sprintf(
'Private method %s::%s() cannot be abstract.',
$method->getDeclaringClass()->getDisplayName(),
$method->getName(),
Copy link
Member

Choose a reason for hiding this comment

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

Non-ignorable please

@ondrejmirtes ondrejmirtes merged commit 7042805 into phpstan:1.10.x Nov 21, 2023
@ondrejmirtes
Copy link
Member

Thank you. Please do final private next.

@staabm staabm deleted the non-priv branch November 21, 2023 08:12
@staabm
Copy link
Contributor Author

staabm commented Nov 21, 2023

Please do final private next.

what do you have in mind what https://github.com/phpstan/phpstan-src/blob/1.11.x/src/Rules/Methods/FinalPrivateMethodRule.php is not already doing?

@ondrejmirtes
Copy link
Member

oh sorry, I didn't know we already have it

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.

None yet

2 participants