summaryrefslogtreecommitdiffstats
path: root/554.patch
blob: 28696667eab3e7a2bd393168f32028394f6e00f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 71d0493b6817352134317f504eb55e8ce7c7f669 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Fri, 3 Nov 2017 13:55:50 +0100
Subject: [PATCH] Fix count(): Parameter must be an array or an object that
 implements Countable

---
 src/Report/Html/Renderer/File.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Report/Html/Renderer/File.php b/src/Report/Html/Renderer/File.php
index 8f2c929b..975bc0a0 100644
--- a/src/Report/Html/Renderer/File.php
+++ b/src/Report/Html/Renderer/File.php
@@ -304,7 +304,7 @@ protected function renderSource(FileNode $node)
             $popoverTitle   = '';
 
             if (array_key_exists($i, $coverageData)) {
-                $numTests = count($coverageData[$i]);
+                $numTests = ($coverageData[$i] ? count($coverageData[$i]) : 0);
 
                 if ($coverageData[$i] === null) {
                     $trClass = ' class="warning"';