File tree 2 files changed +39
-0
lines changed
tests/PHPStan/Rules/Methods
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -3354,4 +3354,13 @@ public function testTraitMixin(): void
3354
3354
$ this ->analyse ([__DIR__ . '/data/trait-mixin.php ' ], []);
3355
3355
}
3356
3356
3357
+ public function testBug10159 (): void
3358
+ {
3359
+ $ this ->checkThisOnly = false ;
3360
+ $ this ->checkNullables = true ;
3361
+ $ this ->checkUnionTypes = true ;
3362
+ $ this ->checkExplicitMixed = true ;
3363
+ $ this ->analyse ([__DIR__ . '/data/bug-10159.php ' ], []);
3364
+ }
3365
+
3357
3366
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Bug10159 ;
4
+
5
+ class Mixin {
6
+ public function someMethod (): object
7
+ {
8
+ return (object ) [];
9
+ }
10
+ }
11
+
12
+ /**
13
+ * @mixin Mixin
14
+ */
15
+ class ParentClass
16
+ {}
17
+
18
+ /**
19
+ * @method ChildClass someMethod()
20
+ */
21
+ class ChildClass extends ParentClass
22
+ {
23
+ public function methodFromChild (): void
24
+ {}
25
+ }
26
+
27
+ function (): void {
28
+ $ childClass = new ChildClass ();
29
+ $ childClass ->someMethod ()->methodFromChild ();
30
+ };
You can’t perform that action at this time.
0 commit comments