File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -3366,4 +3366,13 @@ public function testTraitMixin(): void
3366
3366
$ this ->analyse ([__DIR__ . '/data/trait-mixin.php ' ], []);
3367
3367
}
3368
3368
3369
+ public function testBug10159 (): void
3370
+ {
3371
+ $ this ->checkThisOnly = false ;
3372
+ $ this ->checkNullables = true ;
3373
+ $ this ->checkUnionTypes = true ;
3374
+ $ this ->checkExplicitMixed = true ;
3375
+ $ this ->analyse ([__DIR__ . '/data/bug-10159.php ' ], []);
3376
+ }
3377
+
3369
3378
}
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