mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Improve count checks slightly
This commit is contained in:
parent
5139d61171
commit
947765c1c6
@ -200,7 +200,7 @@ class ErrorBaseline
|
||||
*/
|
||||
private static function countIssueTypesByFile(array $issues): array
|
||||
{
|
||||
if (0 === count($issues)) {
|
||||
if ($issues === []) {
|
||||
return [];
|
||||
}
|
||||
$groupedIssues = array_reduce(
|
||||
|
@ -621,7 +621,7 @@ class IssueBuffer
|
||||
$total_expression_count = $mixed_counts[0] + $mixed_counts[1];
|
||||
$mixed_expression_count = $mixed_counts[0];
|
||||
|
||||
$normalized_data = 0 === count(self::$issues_data) ? [] : array_merge(...array_values(self::$issues_data));
|
||||
$normalized_data = self::$issues_data === [] ? [] : array_merge(...array_values(self::$issues_data));
|
||||
|
||||
switch ($report_options->format) {
|
||||
case Report::TYPE_COMPACT:
|
||||
|
@ -59,7 +59,7 @@ class Shepherd implements \Psalm\Plugin\Hook\AfterAnalysisInterface
|
||||
unset($build_info['git']);
|
||||
|
||||
if ($build_info) {
|
||||
$normalized_data = 0 === count($issues) ? [] : array_filter(
|
||||
$normalized_data = $issues === [] ? [] : array_filter(
|
||||
array_merge(...array_values($issues)),
|
||||
/**
|
||||
* @param array{severity: string} $i
|
||||
|
Loading…
x
Reference in New Issue
Block a user