Passed
Pull Request — master (#2)
by Rodrigo
02:46
created
src/GoogleChart.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
         foreach ($this->dataProvider->models as $index => $model) {
62 62
             $allModels[$index] = [];
63
-            foreach($this->columns as $column) {
63
+            foreach ($this->columns as $column) {
64 64
                 $allModels[$index][Inflector::slug($column, '_')] = ArrayHelper::getValue($model, $column, null);
65 65
             }
66 66
         }
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
         $allModels = [];
78 78
         $total = max(1, array_sum(array_map(fn($model) => next($model), $this->dataColumns)));
79 79
         
80
-        foreach($this->dataColumns as $index => $model)
80
+        foreach ($this->dataColumns as $index => $model)
81 81
         {
82 82
             $keys = array_keys($model);
83 83
             $key = next($keys);
84 84
             $allModels[$index] = $model;
85
-            $allModels[$index][$key] = ($model[$key]/$total) * 100;
85
+            $allModels[$index][$key] = ($model[$key] / $total) * 100;
86 86
         }
87 87
 
88 88
         return $allModels;
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
     protected function getData()
92 92
     {
93 93
         // adapter as title as optional
94
-        $data = array($this->title? ['label_0', $this->title]: ['label_0']);
94
+        $data = array($this->title ? ['label_0', $this->title] : ['label_0']);
95 95
         
96
-        foreach($this->estimateData as $key => $model){
96
+        foreach ($this->estimateData as $key => $model) {
97 97
             // name column
98 98
             $data [$key + 1] = [strip_tags(array_shift($model))];
99 99
             // values columns
100
-            foreach($model as $attribute => $value) {
100
+            foreach ($model as $attribute => $value) {
101 101
                 $data[$key + 1][] = $value;
102 102
                 // add columns legends
103
-                if(count($data[0]) < count($data[$key + 1])) {
103
+                if (count($data[0]) < count($data[$key + 1])) {
104 104
                     $data[0][] = $attribute;
105 105
                 }
106 106
             }
Please login to merge, or discard this patch.