diff --git a/src/Repository/BookRepository.php b/src/Repository/BookRepository.php index 1854e97d..cb1c7582 100644 --- a/src/Repository/BookRepository.php +++ b/src/Repository/BookRepository.php @@ -134,11 +134,11 @@ public function countBooks(bool $group = false): array if ($group) { foreach ($results as $result) { $type = self::extensionToType($result['extension']); - $types[$type] = $types[$type]??0 + $result['nb']; + $types[$type] = ($types[$type] ?? 0) + $result['nb']; } } else { foreach ($results as $result) { - $types[$result['extension']] = $types[$result['extension']]??0 + $result['nb']; + $types[$result['extension']] = ($types[$result['extension']] ?? 0) + $result['nb']; } }