Passed
Push — master ( c6e4cd...5de612 )
by Darío
01:48
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/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.
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.
test/Db/TableGateway/TableGatewayTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function testCannotStablishConnectionWhenExists()
69 69
     {
70 70
         $options = $this->options;
71
-        $options["dbhost"] = 'myserver';   // this server does not exists
71
+        $options["dbhost"] = 'myserver'; // this server does not exists
72 72
 
73 73
         $errorObject = null;
74 74
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
     public function testCannotStablishConnection()
99 99
     {
100 100
         $options = $this->options;
101
-        $options["dbhost"] = 'myserver';   // this server does not exists
101
+        $options["dbhost"] = 'myserver'; // this server does not exists
102 102
 
103 103
         $entity = new MyEntity();
104 104
         $gateway = new TableGateway($entity, ["other" => $options]);
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
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
         $this->assertEquals(2, $conn->getNumFields());
275 275
         $this->assertEquals(0, $conn->getRowsAffected());
276 276
 
277
-        $rowset = $conn->getArrayResult();    # array with results
277
+        $rowset = $conn->getArrayResult(); # array with results
278 278
         $row = array_shift($rowset);
279 279
 
280 280
         $this->assertArrayHasKey("ID", $row);
@@ -301,12 +301,12 @@  discard block
 block discarded – undo
301 301
         $conn->execute($sql);
302 302
         $rowcount = count($conn->getArrayResult());
303 303
 
304
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
304
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
305 305
 
306 306
         # properties modified by execute() method
307 307
         $this->assertEquals(1, $conn->getNumRows());
308 308
         $this->assertEquals(2, $conn->getNumFields());
309
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
309
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
310 310
 
311 311
         $this->assertTrue($conn->commit());
312 312
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $conn->execute($sql);
316 316
         $rowcount = count($conn->getArrayResult());
317 317
 
318
-        $this->assertTrue(($rowcount === 1));    # the row is available
318
+        $this->assertTrue(($rowcount === 1)); # the row is available
319 319
     }
320 320
 
321 321
     /**
@@ -338,12 +338,12 @@  discard block
 block discarded – undo
338 338
         $conn->execute($sql);
339 339
         $rowcount = count($conn->getArrayResult());
340 340
 
341
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
341
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
342 342
 
343 343
         # properties modified by execute() method
344 344
         $this->assertEquals(1, $conn->getNumRows());
345 345
         $this->assertEquals(2, $conn->getNumFields());
346
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
346
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
347 347
 
348 348
         $this->assertTrue($conn->rollback());
349 349
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $conn->execute($sql);
353 353
         $rowcount = count($conn->getArrayResult());
354 354
 
355
-        $this->assertNotTrue(($rowcount === 1));    # the row is not available
355
+        $this->assertNotTrue(($rowcount === 1)); # the row is not available
356 356
     }
357 357
 
358 358
     /**
@@ -384,12 +384,12 @@  discard block
 block discarded – undo
384 384
         $conn->execute($sql);
385 385
         $rowcount = count($conn->getArrayResult());
386 386
 
387
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
387
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
388 388
 
389 389
         # properties modified by execute() method
390 390
         $this->assertEquals(4, $conn->getNumRows());
391 391
         $this->assertEquals(2, $conn->getNumFields());
392
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
392
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
393 393
 
394 394
         $this->assertTrue($conn->commit());
395 395
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
         $conn->execute($sql);
399 399
         $rowcount = count($conn->getArrayResult());
400 400
 
401
-        $this->assertTrue(($rowcount === 4));    # the rows are available
401
+        $this->assertTrue(($rowcount === 4)); # the rows are available
402 402
     }
403 403
 
404 404
     /**
@@ -430,12 +430,12 @@  discard block
 block discarded – undo
430 430
         $conn->execute($sql);
431 431
         $rowcount = count($conn->getArrayResult());
432 432
 
433
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
433
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
434 434
 
435 435
         # properties modified by execute() method
436 436
         $this->assertEquals(4, $conn->getNumRows());
437 437
         $this->assertEquals(2, $conn->getNumFields());
438
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
438
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
439 439
 
440 440
         $this->assertTrue($conn->rollback());
441 441
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         $conn->execute($sql);
445 445
         $rowcount = count($conn->getArrayResult());
446 446
 
447
-        $this->assertNotTrue(($rowcount === 4));    # the rows are not available
447
+        $this->assertNotTrue(($rowcount === 4)); # the rows are not available
448 448
     }
449 449
 
450 450
     /**
@@ -475,12 +475,12 @@  discard block
 block discarded – undo
475 475
         $conn->execute($sql);
476 476
         $rowcount = count($conn->getArrayResult());
477 477
 
478
-        $this->assertTrue(($rowcount === 2));    # the rows are available for now
478
+        $this->assertTrue(($rowcount === 2)); # the rows are available for now
479 479
 
480 480
         # properties modified by execute() method
481 481
         $this->assertEquals(2, $conn->getNumRows());
482 482
         $this->assertEquals(2, $conn->getNumFields());
483
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
483
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
484 484
 
485 485
         # ends the transaction
486 486
         $conn->endTransaction();
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
         $conn->execute($sql);
491 491
         $rowcount = count($conn->getArrayResult());
492 492
 
493
-        $this->assertTrue(($rowcount === 2));    # the row is available
493
+        $this->assertTrue(($rowcount === 2)); # the row is available
494 494
     }
495 495
 
496 496
     /**
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         $conn->execute($sql);
535 535
         $rowcount = count($conn->getArrayResult());
536 536
 
537
-        $this->assertNotTrue(($rowcount === 0));    # the rows are not available
537
+        $this->assertNotTrue(($rowcount === 0)); # the rows are not available
538 538
 
539 539
         # remove all work
540 540
         $conn->execute("DROP TABLE MYTABLE");
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
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             {
121 121
                 if (is_string($param_values[$i]))
122 122
                     $bind_types .= 's';
123
-                else if(is_float($param_values[$i]))
123
+                else if (is_float($param_values[$i]))
124 124
                     $bind_types .= 'd';
125 125
                 # [POSSIBLE BUG] - To Future revision (What about non-string and non-decimal types ?)
126 126
                 else
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             $this->numFields = $this->dbconn->field_count;
185 185
 
186 186
         if ($this->transac_mode)
187
-            $this->transac_result = is_null($this->transac_result) ? $this->result: $this->transac_result && $this->result;
187
+            $this->transac_result = is_null($this->transac_result) ? $this->result : $this->transac_result && $this->result;
188 188
         /*
189 189
          * Because mysqli_query() returns FALSE on failure, a mysqli_result object for SELECT, SHOW, DESCRIBE or EXPLAIN queries,
190 190
          * and TRUE for other successful queries, it should be handled to return only objects or resources.
Please login to merge, or discard this patch.