File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
tests/PHPStan/Rules/Methods Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -3500,4 +3500,18 @@ public function testBug4801(): void
35003500$ this ->analyse ([__DIR__ . '/data/bug-4801.php ' ], []);
35013501}
35023502
3503+ public function testBug12544 (): void
3504+ {
3505+ $ this ->checkThisOnly = false ;
3506+ $ this ->checkNullables = true ;
3507+ $ this ->checkUnionTypes = true ;
3508+ $ this ->checkExplicitMixed = true ;
3509+ $ this ->analyse ([__DIR__ . '/data/bug-12544.php ' ], [
3510+ [
3511+ 'Call to private method somethingElse() of class Bug12544\Bar. ' ,
3512+ 20 ,
3513+ ],
3514+ ]);
3515+ }
3516+
35033517}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug12544 ;
4+
5+ trait Foo {
6+ public function hello (): string
7+ {
8+ return "Hello from Foo! " ;
9+ }
10+ }
11+
12+ class Bar {
13+ use Foo {
14+ hello as private somethingElse;
15+ }
16+ }
17+
18+ function (Bar $ bar ): void {
19+ $ bar ->hello ();
20+ $ bar ->somethingElse ();
21+ };
You can’t perform that action at this time.
0 commit comments