mirror of
https://github.com/danog/psalm.git
synced 2025-01-23 06:11:25 +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:
parent
bebce06014
commit
2fa943a8a6
@ -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
|
||||
{
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user