Richard van Velzen
Richard van Velzen
Yes, in PHP 7 this class (`Error`) is already defined. I'll modernize the code soon
Selecting the first longest match is the most useful way to go. It precludes a whole bunch of hard-to-debug issues. I'll look into integrating something easy like this. Thanks!
Implementing only "simple" negated types would be useful for #7110 as well, which would allow asserting that something is _not_ of a given type (which is supported by psalm as...
Your callables are only defined to return `Timeline`, that's why they don't get more specific. `array_map()` has some special handling which makes it understand what happens in the callable slightly...
Unfortunately I'm not talking about an extension, but internal handling: https://github.com/phpstan/phpstan-src/blob/75c5574a402e858458bf0f83a5942a22e6cfb737/src/Analyser/MutatingScope.php#L1235
@gnutix fairly unlikely, but this case will be solved when generalization of template types goes away (see phpstan/phpstan-src#1206 for some info on that)
I can't reproduce this. Could you share a small reproducing repository?
Thanks. I don't know if the repo is representative of the original code, but it contains an impossible assertion which is where the error originates. It becomes a lot clearer...
Please provide a small reproducing repo.
Hi @gnutix, your `zip()` and `zipAll()` methods don't annotate that the resulting array can contain `null`s, which is why PHPStan considers your `$expected` to be impossible after the first `assertSame()`....