Skip to content

Commit 6b97398

Browse files
committed
Added regression test
1 parent f6f4768 commit 6b97398

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/PHPStan/Rules/Traits/ConflictingTraitConstantsRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public function testNativeTypes(): void
7979
]);
8080
}
8181

82+
public function testBug11088(): void
83+
{
84+
$this->analyse([__DIR__ . '/data/bug-11088.php'], []);
85+
}
86+
8287
#[RequiresPhp('>= 8.3')]
8388
public function testBug13119(): void
8489
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Bug11088;
4+
5+
trait Foo
6+
{
7+
protected const ARR1 = [
8+
self::KEY => 'int',
9+
];
10+
}
11+
12+
class HelloWorld
13+
{
14+
use Foo;
15+
16+
protected const KEY = 'k1';
17+
18+
protected const ARR = self::ARR1 + [
19+
'a.b' => 'int',
20+
];
21+
}

0 commit comments

Comments
 (0)