Passed
Push — master ( 2d92e4...0d56ed )
by Darío
01:37
created
src/Db/Driver/Oracle.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
             ? $this->dbname
60 60
             :
61 61
                 (!is_null($this->dbport) && !empty($this->dbport))
62
-                    ? $this->dbhost .":". $this->dbport ."/". $this->dbname
63
-                    : $this->dbhost ."/". $this->dbname;
62
+                    ? $this->dbhost . ":" . $this->dbport . "/" . $this->dbname
63
+                    : $this->dbhost . "/" . $this->dbname;
64 64
 
65
-        $conn = @oci_connect($this->dbuser,  $this->dbpass, $connection_string, $this->dbchar);
65
+        $conn = @oci_connect($this->dbuser, $this->dbpass, $connection_string, $this->dbchar);
66 66
 
67 67
         if ($conn === false)
68 68
         {
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $prev_error_handler = set_error_handler(['\Drone\Error\ErrorHandler', 'errorControlOperator'], E_ALL);
132 132
 
133 133
         // may be throw a Fatal error (Ex: Maximum execution time)
134
-        $r = ($this->transac_mode) ? oci_execute($stid, OCI_NO_AUTO_COMMIT) : oci_execute($stid,  OCI_COMMIT_ON_SUCCESS);
134
+        $r = ($this->transac_mode) ? oci_execute($stid, OCI_NO_AUTO_COMMIT) : oci_execute($stid, OCI_COMMIT_ON_SUCCESS);
135 135
 
136 136
         set_error_handler($prev_error_handler);
137 137
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $this->numFields = oci_num_fields($stid);
153 153
 
154 154
         if ($this->transac_mode)
155
-            $this->transac_result = is_null($this->transac_result) ? $stid: $this->transac_result && $stid;
155
+            $this->transac_result = is_null($this->transac_result) ? $stid : $this->transac_result && $stid;
156 156
 
157 157
         $this->result = $stid;
158 158
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         if ($this->result)
199 199
         {
200
-            while ( ($row = @oci_fetch_array($this->result, OCI_BOTH + OCI_RETURN_NULLS)) !== false )
200
+            while (($row = @oci_fetch_array($this->result, OCI_BOTH + OCI_RETURN_NULLS)) !== false)
201 201
             {
202 202
                 $data[] = $row;
203 203
             }
Please login to merge, or discard this patch.
src/Db/Driver/SQLServer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         else
133 133
         {
134 134
             if ($isSelectStm)
135
-                $exec = $this->result = sqlsrv_query($this->dbconn, $sql, $params, array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
135
+                $exec = $this->result = sqlsrv_query($this->dbconn, $sql, $params, array("Scrollable" => SQLSRV_CURSOR_KEYSET));
136 136
             else
137 137
                 $exec = $this->result = sqlsrv_query($this->dbconn, $sql, $params);
138 138
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $this->rowsAffected = sqlsrv_rows_affected($this->result);
159 159
 
160 160
         if ($this->transac_mode)
161
-            $this->transac_result = is_null($this->transac_result) ? $this->result: $this->transac_result && $this->result;
161
+            $this->transac_result = is_null($this->transac_result) ? $this->result : $this->transac_result && $this->result;
162 162
 
163 163
         return $this->result;
164 164
     }
Please login to merge, or discard this patch.
src/Db/Driver/MySQL.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             {
119 119
                 if (is_string($param_values[$i]))
120 120
                     $bind_types .= 's';
121
-                else if(is_float($param_values[$i]))
121
+                else if (is_float($param_values[$i]))
122 122
                     $bind_types .= 'd';
123 123
                 # [POSSIBLE BUG] - To Future revision (What about non-string and non-decimal types ?)
124 124
                 else
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             $this->numFields = $this->dbconn->field_count;
179 179
 
180 180
         if ($this->transac_mode)
181
-            $this->transac_result = is_null($this->transac_result) ? $this->result: $this->transac_result && $this->result;
181
+            $this->transac_result = is_null($this->transac_result) ? $this->result : $this->transac_result && $this->result;
182 182
 
183 183
         /*
184 184
          * Because mysqli_query() returns FALSE on failure, a mysqli_result object for SELECT, SHOW, DESCRIBE or EXPLAIN queries,
Please login to merge, or discard this patch.
src/FileSystem/Shell.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -92,28 +92,28 @@  discard block
 block discarded – undo
92 92
             {
93 93
                 foreach ($contents as $i)
94 94
                 {
95
-                    if (is_file($directory.'/'.$i))
95
+                    if (is_file($directory . '/' . $i))
96 96
                     {
97 97
                         $allContents[] = $i;
98 98
 
99
-                        $this->buffer = $directory.'/'.$i;
99
+                        $this->buffer = $directory . '/' . $i;
100 100
                         call_user_func($fileCallback, $this);
101 101
                     }
102
-                    else if (is_dir($directory.'/'.$i))
102
+                    else if (is_dir($directory . '/' . $i))
103 103
                     {
104
-                        $directory_name = basename($directory).'/'.$i;
104
+                        $directory_name = basename($directory) . '/' . $i;
105 105
 
106 106
                         if (strpos($directory_name, './') === 0)
107 107
                         {
108 108
                             $from = './';
109
-                            $from = '/'.preg_quote($from, '/').'/';
109
+                            $from = '/' . preg_quote($from, '/') . '/';
110 110
                             $directory_name = preg_replace($from, "", $directory_name, 1);
111 111
                         }
112 112
 
113 113
                         $allContents[$directory_name] =
114
-                            $this->getContents($directory.'/'.$i, $fileCallback, $dirCallback);
114
+                            $this->getContents($directory . '/' . $i, $fileCallback, $dirCallback);
115 115
 
116
-                        $this->buffer = $directory.'/'.$i;
116
+                        $this->buffer = $directory . '/' . $i;
117 117
                         call_user_func($dirCallback, $this);
118 118
                     }
119 119
                 }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 if (!empty($path))
188 188
                     if (!strlen(stristr($item, $path)) > 0)
189 189
                         continue;
190
-                if (strstr($item,'~') === false && $item != '.' && $item != '..')
190
+                if (strstr($item, '~') === false && $item != '.' && $item != '..')
191 191
                     $filesToReturn[] = $item;
192 192
             }
193 193
         }
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                     {
332 332
                         foreach ($files["folders"] as $folder)
333 333
                         {
334
-                            if (!file_exists($dest.'/'.$folder))
334
+                            if (!file_exists($dest . '/' . $folder))
335 335
                                 mkdir("$dest/$folder", 0777, true);
336 336
                         }
337 337
 
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                             foreach ($files["files"] as $item)
341 341
                             {
342 342
                                 if (!file_exists("$dest/$item"))
343
-                                    copy($item, $dest.'/'.$item);
343
+                                    copy($item, $dest . '/' . $item);
344 344
                             }
345 345
                         }
346 346
                     }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                         array_shift($files["folders"]);
351 351
 
352 352
                         $from = "$file/";
353
-                        $from = '/'.preg_quote($from, '/').'/';
353
+                        $from = '/' . preg_quote($from, '/') . '/';
354 354
 
355 355
                         if (count($files["folders"]))
356 356
                         {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                             {
359 359
                                 $_folder = preg_replace($from, "", $folder, 1);
360 360
 
361
-                                if (!file_exists($dest.'/'.$_folder))
361
+                                if (!file_exists($dest . '/' . $_folder))
362 362
                                     mkdir("$dest/$_folder", 0777, true);
363 363
                             }
364 364
                         }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                                 $_item = preg_replace($from, "", $item, 1);
371 371
 
372 372
                                 if (!file_exists("$dest/$_item"))
373
-                                    copy($item, $dest.'/'.$_item);
373
+                                    copy($item, $dest . '/' . $_item);
374 374
                             }
375 375
                         }
376 376
                     }
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 
381 381
         }
382 382
         else if (is_dir($dest))
383
-            copy($file, $dest.'/'.$file);
383
+            copy($file, $dest . '/' . $file);
384 384
         else
385 385
             copy($file, $dest);
386 386
 
@@ -401,12 +401,12 @@  discard block
 block discarded – undo
401 401
             throw new \InvalidArgumentException("Missing parameters");
402 402
 
403 403
         if (is_dir($newfile))
404
-            $newfile .= '/'.basename($oldfile);
404
+            $newfile .= '/' . basename($oldfile);
405 405
 
406 406
         if ($oldfile == $newfile)
407 407
             throw new \Exception("'$oldfile' and '$newfile' are the same file");
408 408
 
409
-        if(!rename($oldfile, $newfile))
409
+        if (!rename($oldfile, $newfile))
410 410
             return false;
411 411
 
412 412
         return true;
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         else {
437 437
             if (!is_dir($dir))
438 438
             {
439
-                if(!mkdir("$dir", 0777))
439
+                if (!mkdir("$dir", 0777))
440 440
                     return false;
441 441
             }
442 442
         }
Please login to merge, or discard this patch.
src/Network/Socket/Server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
     public function listen(Array $eventHandlers = array())
75 75
     {
76 76
         $event = $eventHandlers;
77
-        $clousure = function(){};
77
+        $clousure = function() {};
78 78
 
79 79
         if (!array_key_exists('success', $event))
80 80
             $event["success"] = $clousure;
Please login to merge, or discard this patch.
test/Db/Driver/MySQLTest.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     public function testCannotStablishConnection()
146 146
     {
147 147
         $options = $this->options;
148
-        $options["dbhost"] = 'myserver';   // this server does not exists
148
+        $options["dbhost"] = 'myserver'; // this server does not exists
149 149
 
150 150
         $conn = new MySQL($options);
151 151
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         $this->assertEquals(2, $conn->getNumFields());
274 274
         $this->assertEquals(0, $conn->getRowsAffected());
275 275
 
276
-        $rowset = $conn->getArrayResult();    # array with results
276
+        $rowset = $conn->getArrayResult(); # array with results
277 277
         $row = array_shift($rowset);
278 278
 
279 279
         $this->assertArrayHasKey("ID", $row);
@@ -300,12 +300,12 @@  discard block
 block discarded – undo
300 300
         $conn->execute($sql);
301 301
         $rowcount = count($conn->getArrayResult());
302 302
 
303
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
303
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
304 304
 
305 305
         # properties modified by execute() method
306 306
         $this->assertEquals(1, $conn->getNumRows());
307 307
         $this->assertEquals(2, $conn->getNumFields());
308
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
308
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
309 309
 
310 310
         $this->assertTrue($conn->commit());
311 311
 
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
         $conn->execute($sql);
315 315
         $rowcount = count($conn->getArrayResult());
316 316
 
317
-        $this->assertTrue(($rowcount === 1));    # the row is available
317
+        $this->assertTrue(($rowcount === 1)); # the row is available
318 318
     }
319 319
 
320 320
     /**
@@ -337,12 +337,12 @@  discard block
 block discarded – undo
337 337
         $conn->execute($sql);
338 338
         $rowcount = count($conn->getArrayResult());
339 339
 
340
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
340
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
341 341
 
342 342
         # properties modified by execute() method
343 343
         $this->assertEquals(1, $conn->getNumRows());
344 344
         $this->assertEquals(2, $conn->getNumFields());
345
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
345
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
346 346
 
347 347
         $this->assertTrue($conn->rollback());
348 348
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         $conn->execute($sql);
352 352
         $rowcount = count($conn->getArrayResult());
353 353
 
354
-        $this->assertNotTrue(($rowcount === 1));    # the row is not available
354
+        $this->assertNotTrue(($rowcount === 1)); # the row is not available
355 355
     }
356 356
 
357 357
     /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
         $conn->execute($sql);
384 384
         $rowcount = count($conn->getArrayResult());
385 385
 
386
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
386
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
387 387
 
388 388
         # properties modified by execute() method
389 389
         $this->assertEquals(4, $conn->getNumRows());
390 390
         $this->assertEquals(2, $conn->getNumFields());
391
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
391
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
392 392
 
393 393
         $this->assertTrue($conn->commit());
394 394
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         $conn->execute($sql);
398 398
         $rowcount = count($conn->getArrayResult());
399 399
 
400
-        $this->assertTrue(($rowcount === 4));    # the row is available
400
+        $this->assertTrue(($rowcount === 4)); # the row is available
401 401
     }
402 402
 
403 403
     /**
@@ -429,12 +429,12 @@  discard block
 block discarded – undo
429 429
         $conn->execute($sql);
430 430
         $rowcount = count($conn->getArrayResult());
431 431
 
432
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
432
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
433 433
 
434 434
         # properties modified by execute() method
435 435
         $this->assertEquals(4, $conn->getNumRows());
436 436
         $this->assertEquals(2, $conn->getNumFields());
437
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
437
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
438 438
 
439 439
         $this->assertTrue($conn->rollback());
440 440
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
         $conn->execute($sql);
444 444
         $rowcount = count($conn->getArrayResult());
445 445
 
446
-        $this->assertNotTrue(($rowcount === 4));    # the row is available
446
+        $this->assertNotTrue(($rowcount === 4)); # the row is available
447 447
     }
448 448
 
449 449
     /**
@@ -474,12 +474,12 @@  discard block
 block discarded – undo
474 474
         $conn->execute($sql);
475 475
         $rowcount = count($conn->getArrayResult());
476 476
 
477
-        $this->assertTrue(($rowcount === 2));    # the rows are available for now
477
+        $this->assertTrue(($rowcount === 2)); # the rows are available for now
478 478
 
479 479
         # properties modified by execute() method
480 480
         $this->assertEquals(2, $conn->getNumRows());
481 481
         $this->assertEquals(2, $conn->getNumFields());
482
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
482
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
483 483
 
484 484
         # ends the transaction
485 485
         $conn->endTransaction();
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         $conn->execute($sql);
490 490
         $rowcount = count($conn->getArrayResult());
491 491
 
492
-        $this->assertTrue(($rowcount === 2));    # the row is available
492
+        $this->assertTrue(($rowcount === 2)); # the row is available
493 493
     }
494 494
 
495 495
     /**
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
         $conn->execute($sql);
534 534
         $rowcount = count($conn->getArrayResult());
535 535
 
536
-        $this->assertNotTrue(($rowcount === 0));    # the rows are not available
536
+        $this->assertNotTrue(($rowcount === 0)); # the rows are not available
537 537
 
538 538
         # remove all work
539 539
         $conn->execute("DROP TABLE MYTABLE");
Please login to merge, or discard this patch.
src/Util/DateTime.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 break;
95 95
 
96 96
             case self::LAST_YEAR:
97
-                $year = ((int) date('Y'))- 1;
97
+                $year = ((int) date('Y')) - 1;
98 98
                 break;
99 99
 
100 100
             default:
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
                 $d->setDate($year, (int) $d->format('m'), (int) $d->format('d'));
143 143
             }
144 144
 
145
-            $d->add(new \DateInterval('P'.($day - 1).'D'));
145
+            $d->add(new \DateInterval('P' . ($day - 1) . 'D'));
146 146
         }
147 147
 
148 148
         return $d;
Please login to merge, or discard this patch.
test/Error/ErrorTraitTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
     public function getContentsFromUrl($filename)
127 127
     {
128 128
         $headers = get_headers($url);
129
-        $exists = stripos($headers[0],"200 OK") ? true : false;
129
+        $exists = stripos($headers[0], "200 OK") ? true : false;
130 130
 
131 131
         if ($exists)
132 132
             return file_get_contents($filename);
Please login to merge, or discard this patch.