File tree Expand file tree Collapse file tree
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1272,6 +1272,14 @@ public function testBug13537(): void
12721272 $ this ->analyse ([__DIR__ . '/data/bug-13537.php ' ], $ errors );
12731273 }
12741274
1275+ public function testBug12390 (): void
1276+ {
1277+ $ this ->checkThisOnly = false ;
1278+ $ this ->checkUnionTypes = true ;
1279+ $ this ->checkDynamicProperties = true ;
1280+ $ this ->analyse ([__DIR__ . '/data/bug-12390.php ' ], []);
1281+ }
1282+
12751283 public function testBug13539 (): void
12761284 {
12771285 $ this ->checkThisOnly = false ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ function testIssetOnGenericObject (object $ obj ): void
4+ {
5+ if (isset ($ obj ->foo )) {
6+ }
7+ }
8+
9+ function testChainedIssetOnGenericObject (object $ obj ): void
10+ {
11+ if (isset ($ obj ->foo ) && isset ($ obj ->bar )) {
12+ }
13+ }
14+
15+ function testIssetAfterIsObjectNarrowing (string $ date ): void
16+ {
17+ if (is_object ($ obj = json_decode ($ date ))) {
18+ if (isset ($ obj ->crashId ) && is_string ($ obj ->crashId )) {
19+ var_dump ($ obj ->crashId );
20+ }
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments