Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add abort to list of early terminating calls #567

Merged
merged 1 commit into from
May 7, 2020

Conversation

Daanra
Copy link
Contributor

@Daanra Daanra commented May 6, 2020

  • Added or updated tests
  • Documented user facing changes
  • Updated CHANGELOG.md

Changes

Adds abort to the list of early terminating function calls. See https://phpstan.org/writing-php-code/solving-undefined-variables.

@szepeviktor
Copy link
Collaborator

Thank you very much @Daanra!

This is almost perfect.

Could you add abort variations?
https://github.com/laravel/framework/blob/7.x/src/Illuminate/Foundation/helpers.php

@szepeviktor szepeviktor self-requested a review May 6, 2020 21:22
@Daanra
Copy link
Contributor Author

Daanra commented May 7, 2020

Could you add abort variations?
https://github.com/laravel/framework/blob/7.x/src/Illuminate/Foundation/helpers.php

Do you mean abort_if and abort_unless?

If so, these are not guaranteed to always terminate. Because they only terminate based on some condition we should not add them to the list of earlyTerminatingFunctionCalls, right? What you can do, is write a type specifying extension for both these methods but we already have them here.

@szepeviktor
Copy link
Collaborator

szepeviktor commented May 7, 2020

If so, these are not guaranteed to always terminate.

I see.

@szepeviktor szepeviktor merged commit 17b27ab into larastan:master May 7, 2020
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