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 1685f3e commit b08d974Copy full SHA for b08d974
tests/PHPStan/Analyser/nsrt/remember-non-nullable-property.php
@@ -19,6 +19,21 @@ public function doFoo(): void {
19
}
20
21
22
+class DontCoercePhpdocType {
23
+ /** @var int */
24
+ private $i;
25
+
26
+ public function __construct()
27
+ {
28
+ $this->i = getIntOrNull();
29
+ }
30
31
+ public function doFoo(): void {
32
+ assertType('mixed', $this->i);
33
+ assertNativeType('mixed', $this->i);
34
35
+}
36
37
function getIntOrNull(): ?int {
38
if (rand(0, 1) === 0) {
39
return null;
@@ -52,8 +67,8 @@ function getIntOrFloatOrNull(): null|int|float {
52
67
return 1;
53
68
54
69
55
-class NarrowsUnion {
56
- private readonly int|float $i;
70
+class NarrowsNativeUnion {
71
+ private int|float $i;
57
72
58
73
public function __construct()
59
74
{
0 commit comments