Completed
Push — master ( 76ebac...80d2a1 )
by Burak
02:09
created
class.sudoxu.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
     private $limit,
10 10
             $sq,
11 11
             $chars,
12
-            $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');
12
+            $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');
13 13
 
14 14
     public function __construct($limit = 9)
15 15
     {
16 16
         ini_set('memory_limit', -1);
17 17
         set_time_limit(0);
18 18
 
19
-        ini_set('display_errors',1);
19
+        ini_set('display_errors', 1);
20 20
         error_reporting(E_ALL);
21 21
 
22 22
         $this->number = 0;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function logic()
33 33
     {
34
-        if(count($this->stack) < $this->limit)
34
+        if (count($this->stack) < $this->limit)
35 35
         {
36 36
             echo 'error';
37 37
             exit;
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $row_temp = array();
123 123
         for ($x = 0; $x < $this->limit; $x++)
124 124
         {
125
-            if(!isset($this->sudoku[$row * $this->limit + $x]))
125
+            if (!isset($this->sudoku[$row * $this->limit + $x]))
126 126
             {
127 127
                 $this->sudoku[$row * $this->limit + $x] = null;
128 128
             }
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
         $timing       = $this->microtime() - $start;
296 296
         $this->result = array(
297
-            'created_in' => round($timing,2),
297
+            'created_in' => round($timing, 2),
298 298
             'difficulty' => 'N/A'
299 299
         );
300 300
 
@@ -313,15 +313,15 @@  discard block
 block discarded – undo
313 313
 
314 314
     public function to($to)
315 315
     {
316
-        if($to == 'json')
316
+        if ($to == 'json')
317 317
         {
318 318
             return json_encode($this->array2export());
319 319
         }
320
-        else if($to == 'serialize')
320
+        else if ($to == 'serialize')
321 321
         {
322 322
             return serialize($this->array2export());
323 323
         }
324
-        else if($to == 'html')
324
+        else if ($to == 'html')
325 325
         {
326 326
             return serialize($this->array2export());
327 327
         }
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
                 $string .= '<td
362 362
                             data-row="'.$u.'"
363 363
                             data-col="'.$v.'"
364
-                            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;">';
365
-                $string .=($this->sudoku[$v * $this->limit + $u]);
364
+                            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;">';
365
+                $string .= ($this->sudoku[$v * $this->limit + $u]);
366 366
                 $string .= '</td>';
367 367
 
368 368
             }
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
         $string .= "</table>";
375 375
 
376 376
 
377
-        if($echo === true)
377
+        if ($echo === true)
378 378
         {
379 379
             echo $string;
380 380
         }
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.
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.