Skip to content

Prevent unnecessary work around parametersAcceptor->getParameters() call-sites#4792

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:unn
Jan 20, 2026
Merged

Prevent unnecessary work around parametersAcceptor->getParameters() call-sites#4792
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:unn

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Jan 20, 2026

depending on the used reflection or acceptor type getParameters() can be expensive.
don't invoke it when we might return without using the result.
also use variables instead of calling it twice

@ondrejmirtes ondrejmirtes merged commit ea435a4 into phpstan:2.1.x Jan 20, 2026
626 of 636 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the unn branch January 20, 2026 16:43
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