We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bb13d8 commit d338a47Copy full SHA for d338a47
tests/PHPStan/Analyser/nsrt/bug-12393b.php
@@ -507,7 +507,32 @@ public function doFoo(array $arr): void
507
assertType("non-empty-array&hasOffsetValue('foo', 'bar')", $this->foo);
508
}
509
510
+}
511
+
512
+class FooTypedArray
513
+{
514
+ /**
515
+ * @var array<int>
516
+ */
517
+ public array $foo;
518
519
520
+ * @param array<float> $arr
521
522
+ public function doFoo(array $arr): void
523
+ {
524
+ $this->foo = $arr;
525
+ assertType('array<float>', $this->foo);
526
+ }
527
528
529
+ * @param array<string> $arr
530
531
+ public function doBar(array $arr): void
532
533
534
+ assertType('array<string>', $this->foo);
535
536
537
538
class FooList
0 commit comments