Skip to content

Commit 0b14dd8

Browse files
author
Cristi Cotet
committed
Fixed #551 count(): Parameter must be an array or an object that implements Countable
1 parent 77a1ba8 commit 0b14dd8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Report/Html/Renderer/File.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,11 @@ protected function renderSource(FileNode $node)
304304
$popoverTitle = '';
305305

306306
if (array_key_exists($i, $coverageData)) {
307-
$numTests = count($coverageData[$i]);
307+
if (is_array($coverageData[$i])) {
308+
$numTests = count($coverageData[$i]);
309+
} else {
310+
$numTests = 0;
311+
}
308312

309313
if ($coverageData[$i] === null) {
310314
$trClass = ' class="warning"';

0 commit comments

Comments
 (0)