Skip to content

Commit 54a5136

Browse files
committed
Regression test
Closes phpstan/phpstan#12327
1 parent a4a008e commit 54a5136

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,15 @@ public function testBug7214(): void
801801
$this->assertSame(6, $errors[0]->getLine());
802802
}
803803

804+
public function testBug12327(): void
805+
{
806+
$errors = $this->runAnalyse(__DIR__ . '/data/bug-12327.php');
807+
$this->assertCount(1, $errors);
808+
809+
$this->assertSame('Class Bug12327\DoesNotMatter uses unknown trait Bug12327\ThisTriggersTheIssue.', $errors[0]->getMessage());
810+
$this->assertSame(15, $errors[0]->getLine());
811+
}
812+
804813
public function testBug7215(): void
805814
{
806815
$errors = $this->runAnalyse(__DIR__ . '/data/bug-7215.php');
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Bug12327;
4+
5+
trait SomeInternalTrait__TheNameIsIrrelevant
6+
{
7+
public function something(): void {}
8+
}
9+
10+
class DoesNotMatter
11+
{
12+
use SomeInternalTrait__TheNameIsIrrelevant {
13+
SomeInternalTrait__TheNameIsIrrelevant::something as methodAlias;
14+
}
15+
use ThisTriggersTheIssue;
16+
17+
public function anything(): void {}
18+
}

0 commit comments

Comments
 (0)