File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 7
7
use Drupal \Core \Entity \EntityStorageInterface ;
8
8
use mglaman \PHPStanDrupal \Type \EntityQuery \ConfigEntityQueryType ;
9
9
use mglaman \PHPStanDrupal \Type \EntityQuery \ContentEntityQueryType ;
10
+ use mglaman \PHPStanDrupal \Type \EntityQuery \EntityQueryType ;
10
11
use PhpParser \Node \Expr \MethodCall ;
11
12
use PHPStan \Analyser \Scope ;
12
13
use PHPStan \Reflection \MethodReflection ;
@@ -56,6 +57,10 @@ public function getTypeFromMethodCall(
56
57
$ returnType ->getClassReflection ()
57
58
);
58
59
}
59
- return $ returnType ;
60
+ return new EntityQueryType (
61
+ $ returnType ->getClassName (),
62
+ $ returnType ->getSubtractedType (),
63
+ $ returnType ->getClassReflection ()
64
+ );
60
65
}
61
66
}
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ public function cases(): \Generator
45
45
],
46
46
];
47
47
48
- yield [
48
+ yield ' bug-438.php ' => [
49
49
[__DIR__ . '/data/bug-438.php ' ],
50
50
[]
51
51
];
52
- yield [
52
+ yield ' bug-396a.php ' => [
53
53
[__DIR__ .'/data/bug-396a.php ' ],
54
54
[
55
55
[
@@ -59,11 +59,11 @@ public function cases(): \Generator
59
59
]
60
60
]
61
61
];
62
- yield [
62
+ yield ' bug-396b.php ' => [
63
63
[__DIR__ . '/data/bug-396b.php ' ],
64
64
[]
65
65
];
66
- yield [
66
+ yield ' bug-396c.php ' => [
67
67
[__DIR__ . '/data/bug-396c.php ' ],
68
68
[]
69
69
];
You can’t perform that action at this time.
0 commit comments