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 a6a23dc commit f6e4f87Copy full SHA for f6e4f87
tests/PHPStan/Analyser/NodeScopeResolverTest.php
@@ -497,6 +497,8 @@ public function dataFileAsserts(): iterable
497
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-2142.php');
498
499
yield from $this->gatherAssertTypes(__DIR__ . '/data/math.php');
500
+
501
+ yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-1870.php');
502
}
503
504
/**
tests/PHPStan/Analyser/data/bug-1870.php
@@ -0,0 +1,23 @@
1
+<?php
2
3
+namespace Bug1870;
4
5
+use function PHPStan\Testing\assertType;
6
7
+class Foo
8
+{
9
10
+ public function doFoo(): void
11
+ {
12
+ static $i = 0;
13
+ $i++;
14
+ assertType('(float|int)', $i);
15
+ }
16
17
+ public function doBar(): void
18
19
20
+ assertType('(float|int)', ++$i);
21
22
23
+}
0 commit comments