@@ -298,8 +298,8 @@ |
||
| 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 | |
@@ -108,8 +108,8 @@ |
||
| 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))) |
@@ -59,10 +59,10 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 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 | |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | $this->assertEquals(2, $conn->getNumFields()); |
| 273 | 273 | $this->assertEquals(0, $conn->getRowsAffected()); |
| 274 | 274 | |
| 275 | - $rowset = $conn->getArrayResult(); # array with results |
|
| 275 | + $rowset = $conn->getArrayResult(); # array with results |
|
| 276 | 276 | $row = array_shift($rowset); |
| 277 | 277 | |
| 278 | 278 | $this->assertArrayHasKey("ID", $row); |
@@ -299,12 +299,12 @@ discard block |
||
| 299 | 299 | $result = $conn->execute($sql); |
| 300 | 300 | $rowcount = count($conn->getArrayResult()); |
| 301 | 301 | |
| 302 | - $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
| 302 | + $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
| 303 | 303 | |
| 304 | 304 | # properties modified by execute() method |
| 305 | 305 | $this->assertEquals(1, $conn->getNumRows()); |
| 306 | 306 | $this->assertEquals(2, $conn->getNumFields()); |
| 307 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 307 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 308 | 308 | |
| 309 | 309 | $this->assertTrue($conn->commit()); |
| 310 | 310 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | $result = $conn->execute($sql); |
| 314 | 314 | $rowcount = count($conn->getArrayResult()); |
| 315 | 315 | |
| 316 | - $this->assertTrue(($rowcount === 1)); # the row is available |
|
| 316 | + $this->assertTrue(($rowcount === 1)); # the row is available |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -336,12 +336,12 @@ discard block |
||
| 336 | 336 | $result = $conn->execute($sql); |
| 337 | 337 | $rowcount = count($conn->getArrayResult()); |
| 338 | 338 | |
| 339 | - $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
| 339 | + $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
| 340 | 340 | |
| 341 | 341 | # properties modified by execute() method |
| 342 | 342 | $this->assertEquals(1, $conn->getNumRows()); |
| 343 | 343 | $this->assertEquals(2, $conn->getNumFields()); |
| 344 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 344 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 345 | 345 | |
| 346 | 346 | $this->assertTrue($conn->rollback()); |
| 347 | 347 | |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | $result = $conn->execute($sql); |
| 351 | 351 | $rowcount = count($conn->getArrayResult()); |
| 352 | 352 | |
| 353 | - $this->assertNotTrue(($rowcount === 1)); # the row is not available |
|
| 353 | + $this->assertNotTrue(($rowcount === 1)); # the row is not available |
|
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
@@ -382,12 +382,12 @@ discard block |
||
| 382 | 382 | $result = $conn->execute($sql); |
| 383 | 383 | $rowcount = count($conn->getArrayResult()); |
| 384 | 384 | |
| 385 | - $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
| 385 | + $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
| 386 | 386 | |
| 387 | 387 | # properties modified by execute() method |
| 388 | 388 | $this->assertEquals(4, $conn->getNumRows()); |
| 389 | 389 | $this->assertEquals(2, $conn->getNumFields()); |
| 390 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 390 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 391 | 391 | |
| 392 | 392 | $this->assertTrue($conn->commit()); |
| 393 | 393 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | $result = $conn->execute($sql); |
| 397 | 397 | $rowcount = count($conn->getArrayResult()); |
| 398 | 398 | |
| 399 | - $this->assertTrue(($rowcount === 4)); # the row is available |
|
| 399 | + $this->assertTrue(($rowcount === 4)); # the row is available |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | /** |
@@ -428,12 +428,12 @@ discard block |
||
| 428 | 428 | $result = $conn->execute($sql); |
| 429 | 429 | $rowcount = count($conn->getArrayResult()); |
| 430 | 430 | |
| 431 | - $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
| 431 | + $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
| 432 | 432 | |
| 433 | 433 | # properties modified by execute() method |
| 434 | 434 | $this->assertEquals(4, $conn->getNumRows()); |
| 435 | 435 | $this->assertEquals(2, $conn->getNumFields()); |
| 436 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 436 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 437 | 437 | |
| 438 | 438 | $this->assertTrue($conn->rollback()); |
| 439 | 439 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $result = $conn->execute($sql); |
| 443 | 443 | $rowcount = count($conn->getArrayResult()); |
| 444 | 444 | |
| 445 | - $this->assertNotTrue(($rowcount === 4)); # the row is available |
|
| 445 | + $this->assertNotTrue(($rowcount === 4)); # the row is available |
|
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | /** |
@@ -473,12 +473,12 @@ discard block |
||
| 473 | 473 | $result = $conn->execute($sql); |
| 474 | 474 | $rowcount = count($conn->getArrayResult()); |
| 475 | 475 | |
| 476 | - $this->assertTrue(($rowcount === 2)); # the rows are available for now |
|
| 476 | + $this->assertTrue(($rowcount === 2)); # the rows are available for now |
|
| 477 | 477 | |
| 478 | 478 | # properties modified by execute() method |
| 479 | 479 | $this->assertEquals(2, $conn->getNumRows()); |
| 480 | 480 | $this->assertEquals(2, $conn->getNumFields()); |
| 481 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 481 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
| 482 | 482 | |
| 483 | 483 | # ends the transaction |
| 484 | 484 | $conn->endTransaction(); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | $result = $conn->execute($sql); |
| 489 | 489 | $rowcount = count($conn->getArrayResult()); |
| 490 | 490 | |
| 491 | - $this->assertTrue(($rowcount === 2)); # the row is available |
|
| 491 | + $this->assertTrue(($rowcount === 2)); # the row is available |
|
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | /** |
@@ -532,6 +532,6 @@ discard block |
||
| 532 | 532 | $result = $conn->execute($sql); |
| 533 | 533 | $rowcount = count($conn->getArrayResult()); |
| 534 | 534 | |
| 535 | - $this->assertNotTrue(($rowcount === 0)); # the rows are not available |
|
| 535 | + $this->assertNotTrue(($rowcount === 0)); # the rows are not available |
|
| 536 | 536 | } |
| 537 | 537 | } |
| 538 | 538 | \ No newline at end of file |
@@ -94,20 +94,20 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 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 |
||
| 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, |