Skip to content

Simplify RequireParentConstructCallRule#280

Merged
ondrejmirtes merged 1 commit into
phpstan:2.0.xfrom
staabm:simpl
Aug 30, 2025
Merged

Simplify RequireParentConstructCallRule#280
ondrejmirtes merged 1 commit into
phpstan:2.0.xfrom
staabm:simpl

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Aug 29, 2025

No description provided.

while ($classReflection->getParentClass() !== false) {
$constructor = $classReflection->getParentClass()->hasMethod('__construct') ? $classReflection->getParentClass()->getMethod('__construct') : null;
$constructorWithClassName = $classReflection->getParentClass()->hasMethod($classReflection->getParentClass()->getName()) ? $classReflection->getParentClass()->getMethod($classReflection->getParentClass()->getName()) : null;
$parentClass = $classReflection->getParentClass();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

actually just introducing this $parentClass variable to make it more readable

@ondrejmirtes ondrejmirtes merged commit b043bd8 into phpstan:2.0.x Aug 30, 2025
31 checks passed
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the simpl branch August 30, 2025 08:34
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