Passed
Push — master ( 80d2a1...41f39e )
by Burak
02:00
created
src/Sudoxu/Sudoku.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     private $limit,
18 18
             $sq,
19 19
             $chars,
20
-            $stack = array('1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
20
+            $stack = array('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
21 21
 
22 22
     /**
23 23
      * Sudoku constructor
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public function logic()
47 47
     {
48
-        if(count($this->stack) < $this->limit)
48
+        if (count($this->stack) < $this->limit)
49 49
         {
50 50
             echo 'error';
51 51
             exit;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $row_temp = array();
137 137
         for ($x = 0; $x < $this->limit; $x++)
138 138
         {
139
-            if(!isset($this->sudoku[$row * $this->limit + $x]))
139
+            if (!isset($this->sudoku[$row * $this->limit + $x]))
140 140
             {
141 141
                 $this->sudoku[$row * $this->limit + $x] = null;
142 142
             }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
         $timing       = $this->microtime() - $start;
310 310
         $this->result = array(
311
-            'created_in' => round($timing,2),
311
+            'created_in' => round($timing, 2),
312 312
             'difficulty' => 'N/A'
313 313
         );
314 314
 
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 
328 328
     public function to($to)
329 329
     {
330
-        if($to == 'json')
330
+        if ($to == 'json')
331 331
         {
332 332
             return json_encode($this->array2export());
333 333
         }
334
-        else if($to == 'serialize')
334
+        else if ($to == 'serialize')
335 335
         {
336 336
             return serialize($this->array2export());
337 337
         }
338
-        else if($to == 'html')
338
+        else if ($to == 'html')
339 339
         {
340 340
             return serialize($this->array2export());
341 341
         }
@@ -375,8 +375,8 @@  discard block
 block discarded – undo
375 375
                 $string .= '<td
376 376
                             data-row="'.$u.'"
377 377
                             data-col="'.$v.'"
378
-                            style="border: 1px solid black;border-bottom:' . $border . 'px solid black;border-right:' . $border2 . 'px solid black;line-height: 50px; width: 50px; text-align: center; vertical-align: middle;">';
379
-                $string .=($this->sudoku[$v * $this->limit + $u]);
378
+                            style="border: 1px solid black;border-bottom:' . $border.'px solid black;border-right:'.$border2.'px solid black;line-height: 50px; width: 50px; text-align: center; vertical-align: middle;">';
379
+                $string .= ($this->sudoku[$v * $this->limit + $u]);
380 380
                 $string .= '</td>';
381 381
 
382 382
             }
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         $string .= "</table>";
389 389
 
390 390
 
391
-        if($echo === true)
391
+        if ($echo === true)
392 392
         {
393 393
             echo $string;
394 394
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -316,12 +316,10 @@  discard block
 block discarded – undo
316 316
         if($to == 'json')
317 317
         {
318 318
             return json_encode($this->array2export());
319
-        }
320
-        else if($to == 'serialize')
319
+        } else if($to == 'serialize')
321 320
         {
322 321
             return serialize($this->array2export());
323
-        }
324
-        else if($to == 'html')
322
+        } else if($to == 'html')
325 323
         {
326 324
             return serialize($this->array2export());
327 325
         }
@@ -377,8 +375,7 @@  discard block
 block discarded – undo
377 375
         if($echo === true)
378 376
         {
379 377
             echo $string;
380
-        }
381
-        else
378
+        } else
382 379
         {
383 380
             return $string;
384 381
         }
Please login to merge, or discard this patch.