Passed
Push — master ( c7da61...4151d4 )
by Darío
01:46
created
src/Db/Driver/AbstractDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -298,8 +298,8 @@
 block discarded – undo
298 298
     {
299 299
         foreach ($options as $option => $value)
300 300
         {
301
-            if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set'.$option))
302
-                $this->{'set'.$option}($value);
301
+            if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set' . $option))
302
+                $this->{'set' . $option}($value);
303 303
         }
304 304
     }
305 305
 
Please login to merge, or discard this patch.
src/Network/Socket/AbstractSocket.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@
 block discarded – undo
108 108
     {
109 109
         foreach ($options as $option => $value)
110 110
         {
111
-            if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set'.$option))
112
-            $this->{'set'.$option}($value);
111
+            if (property_exists(__CLASS__, strtolower($option)) && method_exists($this, 'set' . $option))
112
+            $this->{'set' . $option}($value);
113 113
         }
114 114
 
115 115
         if (!($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP)))
Please login to merge, or discard this patch.
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, * and TRUE for other successful queries, it should be handled to return only objects or resources.
Please login to merge, or discard this patch.
test/Db/Driver/MySQLTest.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
     public function testCannotStablishConnection()
145 145
     {
146 146
         $options = $this->options;
147
-        $options["dbhost"] = 'myserver';   // this server does not exists
147
+        $options["dbhost"] = 'myserver'; // this server does not exists
148 148
 
149 149
         $conn = new MySQL($options);
150 150
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $this->assertEquals(2, $conn->getNumFields());
241 241
         $this->assertEquals(0, $conn->getRowsAffected());
242 242
 
243
-        $rowset = $conn->getArrayResult();    # array with results
243
+        $rowset = $conn->getArrayResult(); # array with results
244 244
         $row = array_shift($rowset);
245 245
 
246 246
         $this->assertArrayHasKey("ID", $row);
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
         $result = $conn->execute($sql);
268 268
         $rowcount = count($conn->getArrayResult());
269 269
 
270
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
270
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
271 271
 
272 272
         # properties modified by execute() method
273 273
         $this->assertEquals(1, $conn->getNumRows());
274 274
         $this->assertEquals(2, $conn->getNumFields());
275
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
275
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
276 276
 
277 277
         $this->assertTrue($conn->commit());
278 278
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $result = $conn->execute($sql);
282 282
         $rowcount = count($conn->getArrayResult());
283 283
 
284
-        $this->assertTrue(($rowcount === 1));    # the row is available
284
+        $this->assertTrue(($rowcount === 1)); # the row is available
285 285
     }
286 286
 
287 287
     /**
@@ -304,12 +304,12 @@  discard block
 block discarded – undo
304 304
         $result = $conn->execute($sql);
305 305
         $rowcount = count($conn->getArrayResult());
306 306
 
307
-        $this->assertTrue(($rowcount === 1));    # the row is available for now
307
+        $this->assertTrue(($rowcount === 1)); # the row is available for now
308 308
 
309 309
         # properties modified by execute() method
310 310
         $this->assertEquals(1, $conn->getNumRows());
311 311
         $this->assertEquals(2, $conn->getNumFields());
312
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
312
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
313 313
 
314 314
         $this->assertTrue($conn->rollback());
315 315
 
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
         $result = $conn->execute($sql);
319 319
         $rowcount = count($conn->getArrayResult());
320 320
 
321
-        $this->assertNotTrue(($rowcount === 1));    # the row is not available
321
+        $this->assertNotTrue(($rowcount === 1)); # the row is not available
322 322
     }
323 323
 
324 324
     /**
@@ -350,12 +350,12 @@  discard block
 block discarded – undo
350 350
         $result = $conn->execute($sql);
351 351
         $rowcount = count($conn->getArrayResult());
352 352
 
353
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
353
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
354 354
 
355 355
         # properties modified by execute() method
356 356
         $this->assertEquals(4, $conn->getNumRows());
357 357
         $this->assertEquals(2, $conn->getNumFields());
358
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
358
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
359 359
 
360 360
         $this->assertTrue($conn->commit());
361 361
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         $result = $conn->execute($sql);
365 365
         $rowcount = count($conn->getArrayResult());
366 366
 
367
-        $this->assertTrue(($rowcount === 4));    # the row is available
367
+        $this->assertTrue(($rowcount === 4)); # the row is available
368 368
     }
369 369
 
370 370
     /**
@@ -396,12 +396,12 @@  discard block
 block discarded – undo
396 396
         $result = $conn->execute($sql);
397 397
         $rowcount = count($conn->getArrayResult());
398 398
 
399
-        $this->assertTrue(($rowcount === 4));    # the rows are available for now
399
+        $this->assertTrue(($rowcount === 4)); # the rows are available for now
400 400
 
401 401
         # properties modified by execute() method
402 402
         $this->assertEquals(4, $conn->getNumRows());
403 403
         $this->assertEquals(2, $conn->getNumFields());
404
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
404
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
405 405
 
406 406
         $this->assertTrue($conn->rollback());
407 407
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         $result = $conn->execute($sql);
411 411
         $rowcount = count($conn->getArrayResult());
412 412
 
413
-        $this->assertNotTrue(($rowcount === 4));    # the row is available
413
+        $this->assertNotTrue(($rowcount === 4)); # the row is available
414 414
     }
415 415
 
416 416
     /**
@@ -441,12 +441,12 @@  discard block
 block discarded – undo
441 441
         $result = $conn->execute($sql);
442 442
         $rowcount = count($conn->getArrayResult());
443 443
 
444
-        $this->assertTrue(($rowcount === 2));    # the rows are available for now
444
+        $this->assertTrue(($rowcount === 2)); # the rows are available for now
445 445
 
446 446
         # properties modified by execute() method
447 447
         $this->assertEquals(2, $conn->getNumRows());
448 448
         $this->assertEquals(2, $conn->getNumFields());
449
-        $this->assertEquals(0, $conn->getRowsAffected());    # nothing affected (autocommit = false)
449
+        $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false)
450 450
 
451 451
         # ends the transaction
452 452
         $conn->endTransaction();
@@ -456,6 +456,6 @@  discard block
 block discarded – undo
456 456
         $result = $conn->execute($sql);
457 457
         $rowcount = count($conn->getArrayResult());
458 458
 
459
-        $this->assertTrue(($rowcount === 2));    # the row is available
459
+        $this->assertTrue(($rowcount === 2)); # the row is available
460 460
     }
461 461
 }
462 462
\ No newline at end of file
Please login to merge, or discard this patch.
src/FileSystem/Shell.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -94,20 +94,20 @@  discard block
 block discarded – undo
94 94
             {
95 95
                 foreach ($contents as $i)
96 96
                 {
97
-                    if (is_file($directory.'/'.$i))
97
+                    if (is_file($directory . '/' . $i))
98 98
                     {
99
-                        $allContents[] = $directory.'/'.$i;
99
+                        $allContents[] = $directory . '/' . $i;
100 100
 
101
-                        $this->buffer = $directory.'/'.$i;
101
+                        $this->buffer = $directory . '/' . $i;
102 102
                         call_user_func($fileCallback, $this);
103 103
                     }
104
-                    elseif (is_dir($directory.'/'.$i))
104
+                    elseif (is_dir($directory . '/' . $i))
105 105
                     {
106
-                        $allContents[] = $directory.'/'.$i;
106
+                        $allContents[] = $directory . '/' . $i;
107 107
 
108
-                        $this->getContents($directory.'/'.$i, $fileCallback, $dirCallback);
108
+                        $this->getContents($directory . '/' . $i, $fileCallback, $dirCallback);
109 109
 
110
-                        $this->buffer = $directory.'/'.$i;
110
+                        $this->buffer = $directory . '/' . $i;
111 111
                         call_user_func($dirCallback, $this);
112 112
 
113 113
                         /*$directory = scandir($directory);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 if (!empty($path))
208 208
                     if (!strlen(stristr($item, $path)) > 0)
209 209
                         continue;
210
-                if (strstr($item,'~') === false && $item != '.' && $item != '..')
210
+                if (strstr($item, '~') === false && $item != '.' && $item != '..')
211 211
                     $filesToReturn[] = $item;
212 212
             }
213 213
         }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
                     {
345 345
                         foreach ($files["folders"] as $folder)
346 346
                         {
347
-                            if (!file_exists($dest.'/'.$folder))
347
+                            if (!file_exists($dest . '/' . $folder))
348 348
                                 mkdir("$dest/$folder", 0777, true);
349 349
                         }
350 350
                     }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                         foreach ($files["files"] as $item)
355 355
                         {
356 356
                             if (!file_exists("$dest/$files"))
357
-                                copy($item, $dest.'/'.$item);
357
+                                copy($item, $dest . '/' . $item);
358 358
                         }
359 359
                     }
360 360
                 }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
         if (is_dir($dest))
365 365
         {
366 366
             if (!$recursive)
367
-                copy($file, $dest.'/'.$file);
367
+                copy($file, $dest . '/' . $file);
368 368
             else {
369 369
 
370 370
                 $files = array();
@@ -383,14 +383,14 @@  discard block
 block discarded – undo
383 383
 
384 384
                     foreach ($files[1] as $item)
385 385
                     {
386
-                        if (!file_exists($dest.'/'.$item))
386
+                        if (!file_exists($dest . '/' . $item))
387 387
                             mkdir("$dest/$item", 0777, true);
388 388
                     }
389 389
 
390 390
                     foreach ($files[0] as $item)
391 391
                     {
392 392
                         if (!file_exists("$dest/$files"))
393
-                            copy($item, $dest.'/'.$item);
393
+                            copy($item, $dest . '/' . $item);
394 394
                     }
395 395
                 });
396 396
             }
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
             throw new \InvalidArgumentException("Missing first parameter");
416 416
 
417 417
         if (is_dir($newfile))
418
-                $newfile .= '/'.basename($oldfile);
418
+                $newfile .= '/' . basename($oldfile);
419 419
 
420 420
         if ($oldfile == $newfile)
421 421
             throw new \Exception("'$oldfile' and '$newfile' are the same file");
422 422
 
423
-        if(!rename($oldfile, $newfile))
423
+        if (!rename($oldfile, $newfile))
424 424
             return false;
425 425
 
426 426
         return true;
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         else {
451 451
             if (!is_dir($dir))
452 452
             {
453
-                if(!mkdir("$dir", 0777))
453
+                if (!mkdir("$dir", 0777))
454 454
                     return false;
455 455
             }
456 456
         }
Please login to merge, or discard this patch.