Skip to content

Remove unnecessary work in BooleanOrHandler#6106

Merged
staabm merged 3 commits into
phpstan:2.2.xfrom
staabm:prevent-gettyoe
Jul 26, 2026
Merged

Remove unnecessary work in BooleanOrHandler#6106
staabm merged 3 commits into
phpstan:2.2.xfrom
staabm:prevent-gettyoe

Conversation

@staabm

@staabm staabm commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@staabm
staabm marked this pull request as ready for review July 26, 2026 17:17
@phpstan-bot

Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@staabm
staabm requested a review from VincentLanglet July 26, 2026 17:30
$rightTruthyScope = null;

$seen = [];
foreach ([$scope, $rightScope] as $sourceScope) {

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.

when $sourceScope has no conditional expressions, we no longer create $leftTruthyScope, $rightTruthyScope unnecessarily

@staabm staabm changed the title Prevent unnecessary getType() calls in BooleanOrHandler Remove unnecessary work in BooleanOrHandler Jul 26, 2026
@staabm staabm changed the title Remove unnecessary work in BooleanOrHandler Remove unnecessary work in BooleanOrHandler Jul 26, 2026
@staabm
staabm merged commit 11f6482 into phpstan:2.2.x Jul 26, 2026
763 of 772 checks passed
@staabm
staabm deleted the prevent-gettyoe branch July 26, 2026 20:32
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.

3 participants