File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2033,6 +2033,14 @@ public function dataInstanceOf(): array
20332033'static(InstanceOfNamespace\Foo) ' ,
20342034'clone $static ' ,
20352035],
2036+ [
2037+ 'InstanceOfNamespace\BarInterface&InstanceOfNamespace\Foo ' ,
2038+ '$intersected ' ,
2039+ ],
2040+ [
2041+ '$this(InstanceOfNamespace\Foo)&InstanceOfNamespace\BarInterface ' ,
2042+ '$this ' ,
2043+ ],
20362044];
20372045}
20382046
Original file line number Diff line number Diff line change 55use PhpParser \Node \Expr ;
66use PhpParser \Node \Expr \ArrayDimFetch ;
77
8+ interface BarInterface
9+ {
10+
11+ }
12+
813class Foo
914{
1015
1116public function someMethod (Expr $ foo )
1217{
1318$ bar = $ foo ;
1419$ baz = doFoo ();
20+ $ intersected = new Foo ();
1521
1622if ($ baz instanceof Foo) {
1723// ...
@@ -21,7 +27,11 @@ public function someMethod(Expr $foo)
2127if ($ dolor instanceof Dolor && $ sit instanceof Sit) {
2228if ($ static instanceof static) {
2329if ($ self instanceof self) {
24- die;
30+ if ($ intersected instanceof BarInterface) {
31+ if ($ this instanceof BarInterface) {
32+ die;
33+ }
34+ }
2535}
2636}
2737}
You can’t perform that action at this time.
0 commit comments