Closed clxmstaab closed 3 years ago
This issue is probably totally different, it's about ConstantArrayType::accepts()
behaviour in core PHPStan.
This issue is probably totally different, it's about
ConstantArrayType::accepts()
behaviour in core PHPStan.
hmm I guess this means I am lost now. Could you give me some more pointers? or is it something very deep in the core, which a beginner will not be able to fix?
I already tried to narrow it down on phpstan.org
using array_key_exists
directly seem to work like expected.
https://phpstan.org/r/1d951760-7d0d-47bc-bed6-429eeaa5de58
I got the impression that phpstan rewrites the ast to something like
array_key_exists('password', $data);
array_key_exists('email', $data);
a($data);
while it should be more something like
if (array_key_exists('password', $data) && array_key_exists('email', $data)) {
a($data);
}
If this works https://phpstan.org/r/47c28281-644a-4193-bb02-5fa61cbcb93f then this extension has to work too...
If this works https://phpstan.org/r/47c28281-644a-4193-bb02-5fa61cbcb93f then this extension has to work too...
Hmm this looks like expected to me, right?
any more pointers where the error might come from?
I dont know where the difference is, but I am now able to reproduce the issue on phpstan
error reported upstream: https://github.com/phpstan/phpstan/issues/4560
adds failing test for https://github.com/phpstan/phpstan-webmozart-assert/issues/39
it seems there is already some kind of
keyExists
handling, but it does not work yet for the added testcase