Skip to content

Commit 3e6e696

Browse files
committed
Fix error count by type
1 parent 3635758 commit 3e6e696

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BaselineSplitter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
use ShipMonk\PHPStan\Baseline\Exception\ErrorException;
66
use ShipMonk\PHPStan\Baseline\Handler\HandlerFactory;
77
use SplFileInfo;
8+
use function array_reduce;
89
use function assert;
9-
use function count;
1010
use function dirname;
1111
use function file_put_contents;
1212
use function is_array;
@@ -62,7 +62,7 @@ public function split(string $loaderFilePath): array
6262
foreach ($groupedErrors as $identifier => $errors) {
6363
$fileName = $identifier . '.' . $extension;
6464
$filePath = $folder . '/' . $fileName;
65-
$errorsCount = count($errors);
65+
$errorsCount = array_reduce($errors, static fn(int $carry, array $item): int => $carry + $item['count'], 0);
6666

6767
$outputInfo[$filePath] = $errorsCount;
6868
$baselineFiles[] = $fileName;

0 commit comments

Comments
 (0)