phpstan-src icon indicating copy to clipboard operation
phpstan-src copied to clipboard

Fix class-const resolving will always evaluate to true/false in traits

Open staabm opened this issue 2 years ago • 2 comments

closes https://github.com/phpstan/phpstan/issues/4570

see initial discussion and reviews in https://github.com/phpstan/phpstan-src/pull/2046

test fails without the src changes like

1) PHPStan\Rules\Comparison\ImpossibleCheckTypeFunctionCallRuleTest::testBug4570
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'
+'08: Call to function array_key_exists() with 'valueToFetch' and array{someValue: 'abc', valueToFetch: '123'} will always evaluate to true.
+08: Call to function array_key_exists() with 'valueToFetch' and array{someValue: 'abc', someOtherValue: '123'} will always evaluate to false.
 '

staabm avatar Apr 09 '23 19:04 staabm

This pull request has been marked as ready for review.

phpstan-bot avatar Apr 09 '23 19:04 phpstan-bot

This pull request has been marked as ready for review.

phpstan-bot avatar Jul 29 '23 11:07 phpstan-bot