Skip to content

Commit

Permalink
Add regression test for anonymous class in trait
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm committed Jan 28, 2022
1 parent daf7d55 commit 138c4a4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,9 @@ public function testBug3723(): void
$this->analyse([__DIR__ . '/data/bug-3723.php'], []);
}

public function testBug6472(): void
{
$this->analyse([__DIR__ . '/data/bug-6472.php'], []);
}

}
29 changes: 29 additions & 0 deletions tests/PHPStan/Rules/Methods/data/bug-6472.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Bug6472;

trait A
{
/**
* @param mixed[] $array
*/
public static function a(array $array): void
{
new class {

};
}

/**
* @param mixed[] $array
*/
public static function b(array $array): void
{
}

}

class B
{
use A;
}

0 comments on commit 138c4a4

Please sign in to comment.