Skip to content

Conversation

rvanvelzen
Copy link
Contributor

Partial solution for phpstan/phpstan#7188: check expressions for terminating calls a bit more aggressively.

@ondrejmirtes
Copy link
Member

I think that correct solution would be to handle this similarly to $hasYield and $throwPoints - to collect this information in ExpressionResult and StatementResult. In the end findEarlyTerminatingExpr wouldn't be needed at all.

Another similar data like this to gather is "purity" - "is this expression/statement pure or not?" It's unrelated to this PR, I'm just saying is another thing that should be done in the future, to solve phpstan/phpstan#4426 :)

@rvanvelzen rvanvelzen marked this pull request as draft June 1, 2022 06:51
@rvanvelzen
Copy link
Contributor Author

That seems like a good idea - I'll look into it.

@rvanvelzen rvanvelzen changed the base branch from 1.7.x to 1.8.x September 2, 2022 06:55
@rvanvelzen
Copy link
Contributor Author

I've reduced it to a much simpler version that does the trick as well.

@rvanvelzen rvanvelzen marked this pull request as ready for review September 2, 2022 06:57
@ondrejmirtes
Copy link
Member

Of course, this makes sense :) Thank you.

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