Skip to content

Resolve parameter types only when checkArgumentTypes=true#2106

Merged
ondrejmirtes merged 1 commit intophpstan:1.9.xfrom
staabm:less-greedy
Dec 13, 2022
Merged

Resolve parameter types only when checkArgumentTypes=true#2106
ondrejmirtes merged 1 commit intophpstan:1.9.xfrom
staabm:less-greedy

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented Dec 13, 2022

No description provided.

))->line($argumentLine)->build();
}
if ($this->checkArgumentTypes) {
$parameterType = TypeUtils::resolveLateResolvableTypes($parameter->getType());
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.

defer this resolving until we realy need the value


if ($this->checkUnresolvableParameterTypes
&& $originalParameter !== null
&& isset($messages[13])
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.

moved the cheap isset($messages[13]) condition before the 2 resolving calls

@staabm staabm marked this pull request as ready for review December 13, 2022 20:11
@phpstan-bot
Copy link
Copy Markdown
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit e74be98 into phpstan:1.9.x Dec 13, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@staabm staabm deleted the less-greedy branch December 13, 2022 20:18
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