Skip to content

Commit fc5be6a

Browse files
committed
Fix renamed trait method visibility
1 parent c0aad86 commit fc5be6a

File tree

3 files changed

+52
-4
lines changed

3 files changed

+52
-4
lines changed

composer.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,4 +552,10 @@ public function testCountableBug(): void
552552
$this->analyse([__DIR__ . '/data/countable-bug.php'], []);
553553
}
554554

555+
public function testBug6264(): void
556+
{
557+
$this->phpVersionId = PHP_VERSION_ID;
558+
$this->analyse([__DIR__ . '/data/bug-6264.php'], []);
559+
}
560+
555561
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug6264;
4+
5+
interface Foo
6+
{
7+
public function doFoo(): void;
8+
}
9+
10+
class Bar implements Foo
11+
{
12+
public function doFoo(): void
13+
{
14+
echo "Doing foo the generic way";
15+
}
16+
}
17+
18+
trait SpecificFoo
19+
{
20+
public function doFoo(): void
21+
{
22+
echo "Doing foo the specific way";
23+
}
24+
}
25+
26+
class Baz extends Bar
27+
{
28+
use SpecificFoo {
29+
doFoo as private doFooImpl;
30+
}
31+
32+
public function doFoo(): void
33+
{
34+
echo "Doing foo twice";
35+
$this->doFooImpl();
36+
}
37+
}
38+
39+
class FooBar extends Bar
40+
{
41+
use SpecificFoo;
42+
}

0 commit comments

Comments
 (0)