Test Setup Failed
Push — master ( 2ae703...a1abea )
by Sebastian
03:13
created
src/Calculator/LeftoverFiller.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @see Mistralys\WidthsCalculator\Calculator\LeftoverFiller
7 7
  */
8 8
 
9
-declare (strict_types=1);
9
+declare(strict_types=1);
10 10
 
11 11
 namespace Mistralys\WidthsCalculator\Calculator;
12 12
 
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
         $leftover = $this->calculator->getMaxTotal() - $this->operations->calcTotal();
41 41
         $perCol = $leftover / $this->operations->countColumns();
42 42
 
43
-        if($this->calculator->isIntegerMode())
43
+        if ($this->calculator->isIntegerMode())
44 44
         {
45 45
             $perCol = (int)ceil($perCol);
46 46
         }
47 47
 
48
-        for($i=($this->operations->countColumns()-1); $i >=0; $i--)
48
+        for ($i = ($this->operations->countColumns() - 1); $i >= 0; $i--)
49 49
         {
50
-            if($leftover <= 0)
50
+            if ($leftover <= 0)
51 51
             {
52 52
                 break;
53 53
             }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     */
74 74
     private function cleanUp(float $leftover) : void
75 75
     {
76
-        if($leftover >= 0 || empty($this->columns))
76
+        if ($leftover >= 0 || empty($this->columns))
77 77
         {
78 78
             return;
79 79
         }
Please login to merge, or discard this patch.
src/Calculator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @see Mistralys\WidthsCalculator\Calculator
7 7
  */
8 8
 
9
-declare (strict_types=1);
9
+declare(strict_types=1);
10 10
 
11 11
 namespace Mistralys\WidthsCalculator;
12 12
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     */
58 58
     private function __construct(array $columnValues)
59 59
     {
60
-        foreach($columnValues as $name => $value)
60
+        foreach ($columnValues as $name => $value)
61 61
         {
62 62
             $this->addColumn(
63 63
                 (string)$name, 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         return $this->operations;
108 108
     }
109 109
     
110
-    public function setFloatValues(bool $enable=true) : Calculator
110
+    public function setFloatValues(bool $enable = true) : Calculator
111 111
     {
112 112
         $this->setOption('integerValues', !$enable);
113 113
         return $this;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     {
126 126
         $max = $this->getMaxMinWidth();
127 127
         
128
-        if($width > $max)
128
+        if ($width > $max)
129 129
         {
130 130
             throw new \Exception(
131 131
                 sprintf('Minimum width cannot be set above %s.', number_format($max, 4)),
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
     
164 164
     private function calculate() : void
165 165
     {
166
-        if($this->calculated)
166
+        if ($this->calculated)
167 167
         {
168 168
             return;
169 169
         }
170 170
         
171
-        if($this->operations->calcTotal() > $this->getMaxTotal())
171
+        if ($this->operations->calcTotal() > $this->getMaxTotal())
172 172
         {
173 173
             $this->fixOverflow();
174 174
         }
@@ -189,9 +189,9 @@  discard block
 block discarded – undo
189 189
     private function convertToInteger() : void
190 190
     {
191 191
         // convert all columns to integer values as required
192
-        if($this->isIntegerMode())
192
+        if ($this->isIntegerMode())
193 193
         {
194
-            foreach($this->columns as $col)
194
+            foreach ($this->columns as $col)
195 195
             {
196 196
                 $val = intval(floor($col->getValue()));
197 197
                 $col->setValue(floatval($val));
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
         
212 212
         $result = array();
213 213
         
214
-        foreach($this->columns as $col)
214
+        foreach ($this->columns as $col)
215 215
         {
216 216
             $val = $col->getValue();
217 217
             
218
-            if($this->isIntegerMode())
218
+            if ($this->isIntegerMode())
219 219
             {
220 220
                 $val = intval($val);
221 221
             }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
         $values = $calc->getValues();
246 246
 
247 247
         $result = array();
248
-        foreach($values as $name => $value)
248
+        foreach ($values as $name => $value)
249 249
         {
250 250
             $result[$name] = (int)$value;
251 251
         }
Please login to merge, or discard this patch.