phpstan / phpstan-webmozart-assert

PHPStan extension for webmozart/assert
MIT License
162 stars 28 forks source link

`Assert::notNull()` should warn when argument is never null #154

Closed Creeperface01 closed 1 year ago

Creeperface01 commented 1 year ago

The same issue applies probably to more checks than just this.

In this case $a is never going to be null but phpstan won't show an error

$a = 1;

Assert::notNull($a);
ondrejmirtes commented 1 year ago

It does. Make sure to install phpstan-strict-rules, or enable this option: https://phpstan.org/config-reference#checkalwaystruechecktypefunctioncall

herndlm commented 1 year ago

and we're making sure that this works via https://github.com/phpstan/phpstan-webmozart-assert/blob/1.2.2/tests/Type/WebMozartAssert/ImpossibleCheckTypeMethodCallRuleTest.php#L20 😊

github-actions[bot] commented 1 year ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.