Skip to content

Commit 37440c9

Browse files
authored
Merge branch refs/heads/1.12.x into 2.0.x
2 parents 13dfc76 + b83a1eb commit 37440c9

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3366,4 +3366,13 @@ public function testTraitMixin(): void
33663366
$this->analyse([__DIR__ . '/data/trait-mixin.php'], []);
33673367
}
33683368

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+
33693378
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
};

0 commit comments

Comments
 (0)