From 5170fd7f6ecc90955cc7b32049f9ef9546d425a8 Mon Sep 17 00:00:00 2001 From: msquare Date: Thu, 29 Sep 2016 09:49:25 +0200 Subject: prohibit inline control structures on helpers --- includes/helper/graph_helper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'includes/helper/graph_helper.php') diff --git a/includes/helper/graph_helper.php b/includes/helper/graph_helper.php index 17473634..180d1ef9 100644 --- a/includes/helper/graph_helper.php +++ b/includes/helper/graph_helper.php @@ -9,14 +9,16 @@ */ function bargraph($id, $key, $row_names, $colors, $data) { $labels = []; - foreach ($data as $dataset) + foreach ($data as $dataset) { $labels[] = $dataset[$key]; + } $datasets = []; foreach ($row_names as $row_key => $name) { $values = []; - foreach ($data as $dataset) + foreach ($data as $dataset) { $values[] = $dataset[$row_key]; + } $datasets[] = [ 'label' => $name, 'fillColor' => $colors[$row_key], -- cgit v1.2.3-54-g00ecf