Martin Herndl

Results 139 comments of Martin Herndl

Right, makes sense. I did not further check this yesterday. Maybe some kind of depth limitation for nested arrays (if it is even possible to cleanly remember the current nesting-level...

Fyi I added something like the following to `ConstantArrayTypeBuilder::createFromConstantArray` ```php $depth = 0; TypeTraverser::map($startArrayType, static function (Type $type, callable $traverse) use (&$depth): Type { if ($type instanceof ConstantArrayType) { $depth++;...

Update where we are here atm on my machine: Using ```php $row = [1]; $row[] = $row; $row[] = $row; $row[] = $row; $row[] = $row; $row[] = $row; $row[]...

Hmm I ran out of ideas. To keep me from going insane, I think I'm gonna stop trying to improve the array types for a while :P If somebody wants...

Oh, this is interesting. An isolated test case in `CallStaticMethodsRuleTest` with the rules `checkExplicitMixed` enabled makes this (your initial snippet) still report as expected > Parameter #1 $requireInt of static...

The behaviour seems to have changed with https://github.com/phpstan/phpstan-src/commit/b7f290317d374526e1837b2971ecb8a93e13327e, I'll continue debugging this a bit, if I don't report back with a fix soon, somebody else feel free to use this...

hehe, this is way trickier than I thought. The problem is basically that `(new MixedType(true)->isSuperTypeOf(new MixedType())` returns `yes` which it shouldn't. This is handled correctly via `MixedType::isSuperTypeOfMixed` already, but my...

I played around with `ConstantArrayType::isSuperTypeOf()` a bit and indeed managed to fix the issue here with the changes you described. But it lead to many new errors and it also...

Ok, I'll open a PR for you to look at / finish soon. Before I do that I wanted to take a second look if I can figure out more....

The code triggering this is most likely in https://github.com/phpstan/phpstan-src/blob/1.8.2/src/Analyser/NodeScopeResolver.php#L1803-L1831