1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 22:01:48 +01:00

Shepherd: send a list of issues (instead of array with int keys)

as result Shepherd will send an array is issues instead of object with "random" numeric keys
This commit is contained in:
Alies Lapatsin 2023-05-31 12:24:49 +02:00
parent bebce06014
commit 2fa943a8a6
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ final class AfterAnalysisEvent
{
private Codebase $codebase;
/**
* @var IssueData[][]
* @var array<string, list<IssueData>> where string key is a filepath
*/
private array $issues;
private array $build_info;
@ -19,7 +19,7 @@ final class AfterAnalysisEvent
/**
* Called after analysis is complete
*
* @param array<string, list<IssueData>> $issues
* @param array<string, list<IssueData>> $issues where string key is a filepath
* @internal
*/
public function __construct(
@ -40,7 +40,7 @@ final class AfterAnalysisEvent
}
/**
* @return IssueData[][]
* @return array<string, list<IssueData>> where string key is a filepath
*/
public function getIssues(): array
{

View File

@ -121,10 +121,10 @@ final class Shepherd implements AfterAnalysisInterface
}
$issues = $event->getIssues();
$normalized_data = $issues === [] ? [] : array_filter(
array_merge(...array_values($issues)),
$normalized_data = $issues === [] ? [] : array_values(array_filter(
array_merge(...array_values($issues)), // flatten an array
static fn(IssueData $i): bool => $i->severity === 'error',
);
));
$codebase = $event->getCodebase();