@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | * |
| 303 | 303 | * @param string $path |
| 304 | 304 | * |
| 305 | - * @return array|false |
|
| 305 | + * @return string |
|
| 306 | 306 | */ |
| 307 | 307 | public function read($path) |
| 308 | 308 | { |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | * |
| 351 | 351 | * @param string $path |
| 352 | 352 | * |
| 353 | - * @return array|false |
|
| 353 | + * @return string |
|
| 354 | 354 | */ |
| 355 | 355 | public function getMetadata($path) |
| 356 | 356 | { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $this->connection = new Curl(); |
| 60 | 60 | $this->connection->setOptions([ |
| 61 | 61 | CURLOPT_URL => $this->getUrl(), |
| 62 | - CURLOPT_USERPWD => $this->getUsername() . ':' . $this->getPassword(), |
|
| 62 | + CURLOPT_USERPWD => $this->getUsername().':'.$this->getPassword(), |
|
| 63 | 63 | CURLOPT_SSL_VERIFYPEER => false, |
| 64 | 64 | CURLOPT_SSL_VERIFYHOST => false, |
| 65 | 65 | CURLOPT_FTP_SSL => CURLFTPSSL_TRY, |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $connection = $this->getConnection(); |
| 131 | 131 | |
| 132 | 132 | $result = $connection->exec([ |
| 133 | - CURLOPT_URL => $this->getUrl() . '/' . $path, |
|
| 133 | + CURLOPT_URL => $this->getUrl().'/'.$path, |
|
| 134 | 134 | CURLOPT_UPLOAD => 1, |
| 135 | 135 | CURLOPT_INFILE => $resource, |
| 136 | 136 | ]); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $connection = $this->getConnection(); |
| 186 | 186 | |
| 187 | 187 | $result = $connection->exec([ |
| 188 | - CURLOPT_POSTQUOTE => ['RNFR ' . $path, 'RNTO ' . $newpath], |
|
| 188 | + CURLOPT_POSTQUOTE => ['RNFR '.$path, 'RNTO '.$newpath], |
|
| 189 | 189 | ]); |
| 190 | 190 | |
| 191 | 191 | return $result !== false; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $connection = $this->getConnection(); |
| 223 | 223 | |
| 224 | 224 | $result = $connection->exec([ |
| 225 | - CURLOPT_POSTQUOTE => ['DELE ' . $path], |
|
| 225 | + CURLOPT_POSTQUOTE => ['DELE '.$path], |
|
| 226 | 226 | ]); |
| 227 | 227 | |
| 228 | 228 | return $result !== false; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $connection = $this->getConnection(); |
| 241 | 241 | |
| 242 | 242 | $result = $connection->exec([ |
| 243 | - CURLOPT_POSTQUOTE => ['RMD ' . $dirname], |
|
| 243 | + CURLOPT_POSTQUOTE => ['RMD '.$dirname], |
|
| 244 | 244 | ]); |
| 245 | 245 | |
| 246 | 246 | return $result !== false; |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | $connection = $this->getConnection(); |
| 260 | 260 | |
| 261 | 261 | $result = $connection->exec([ |
| 262 | - CURLOPT_POSTQUOTE => ['MKD ' . $dirname], |
|
| 262 | + CURLOPT_POSTQUOTE => ['MKD '.$dirname], |
|
| 263 | 263 | ]); |
| 264 | 264 | |
| 265 | 265 | if ($result === false) { |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $connection = $this->getConnection(); |
| 330 | 330 | |
| 331 | 331 | $result = $connection->exec([ |
| 332 | - CURLOPT_URL => $this->getUrl() . '/' . $path, |
|
| 332 | + CURLOPT_URL => $this->getUrl().'/'.$path, |
|
| 333 | 333 | CURLOPT_FILE => $stream, |
| 334 | 334 | ]); |
| 335 | 335 | |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | return ['type' => 'dir', 'path' => '']; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - $request = rtrim('LIST -A ' . $this->normalizePath($path)); |
|
| 360 | + $request = rtrim('LIST -A '.$this->normalizePath($path)); |
|
| 361 | 361 | |
| 362 | 362 | $connection = $this->getConnection(); |
| 363 | 363 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | public function getTimestamp($path) |
| 398 | 398 | { |
| 399 | - $response = $this->rawCommand('MDTM ' . $path); |
|
| 399 | + $response = $this->rawCommand('MDTM '.$path); |
|
| 400 | 400 | list($code, $time) = explode(' ', end($response), 2); |
| 401 | 401 | if ($code !== '213') { |
| 402 | 402 | return false; |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | return $this->listDirectoryContentsRecursive($directory); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | - $request = rtrim('LIST -aln ' . $this->normalizePath($directory)); |
|
| 421 | + $request = rtrim('LIST -aln '.$this->normalizePath($directory)); |
|
| 422 | 422 | |
| 423 | 423 | $connection = $this->getConnection(); |
| 424 | 424 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | protected function listDirectoryContentsRecursive($directory) |
| 442 | 442 | { |
| 443 | - $request = rtrim('LIST -aln ' . $this->normalizePath($directory)); |
|
| 443 | + $request = rtrim('LIST -aln '.$this->normalizePath($directory)); |
|
| 444 | 444 | |
| 445 | 445 | $connection = $this->getConnection(); |
| 446 | 446 | $result = $connection->exec([CURLOPT_CUSTOMREQUEST => $request]); |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | // split up the permission groups |
| 477 | 477 | $parts = str_split($permissions, 3); |
| 478 | 478 | // convert the groups |
| 479 | - $mapper = function ($part) { |
|
| 479 | + $mapper = function($part) { |
|
| 480 | 480 | return array_sum(str_split($part)); |
| 481 | 481 | }; |
| 482 | 482 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | protected function rawCommand($command) |
| 532 | 532 | { |
| 533 | 533 | $response = ''; |
| 534 | - $callback = function ($ch, $string) use (&$response) { |
|
| 534 | + $callback = function($ch, $string) use (&$response) { |
|
| 535 | 535 | $response .= $string; |
| 536 | 536 | |
| 537 | 537 | return strlen($string); |
@@ -547,6 +547,6 @@ discard block |
||
| 547 | 547 | |
| 548 | 548 | protected function getUrl() |
| 549 | 549 | { |
| 550 | - return $this->protocol . '://' . $this->getHost() . ':' . $this->getPort(); |
|
| 550 | + return $this->protocol.'://'.$this->getHost().':'.$this->getPort(); |
|
| 551 | 551 | } |
| 552 | 552 | } |