@@ -257,11 +257,11 @@ |
||
| 257 | 257 | $key = substr($parts['path'], 1); |
| 258 | 258 | |
| 259 | 259 | if (null !== $parts['query']) { |
| 260 | - $key .= '?' . $parts['query']; |
|
| 260 | + $key .= '?'.$parts['query']; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | if (null !== $parts['fragment']) { |
| 264 | - $key .= '#' . $parts['fragment']; |
|
| 264 | + $key .= '#'.$parts['fragment']; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | if (empty($domain) || empty($key)) { |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | } else { |
| 90 | 90 | $before = substr($this->content, 0, $this->position); |
| 91 | 91 | $after = $newNumBytes > $newPosition ? substr($this->content, $newPosition) : ''; |
| 92 | - $this->content = $before . $data . $after; |
|
| 92 | + $this->content = $before.$data.$after; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | $this->position = $newPosition; |
@@ -264,8 +264,8 @@ |
||
| 264 | 264 | $this->fileData = array_merge($fileData, $this->fileData); |
| 265 | 265 | |
| 266 | 266 | return [ |
| 267 | - 'keys' => array_keys($fileData), |
|
| 268 | - 'dirs' => $dirs, |
|
| 267 | + 'keys' => array_keys($fileData), |
|
| 268 | + 'dirs' => $dirs, |
|
| 269 | 269 | ]; |
| 270 | 270 | } |
| 271 | 271 | |
@@ -121,13 +121,13 @@ discard block |
||
| 121 | 121 | $this->ensureDirectoryExists($this->directory, $this->create); |
| 122 | 122 | |
| 123 | 123 | $file = $this->computePath($key); |
| 124 | - $lines = ftp_rawlist($this->getConnection(), '-al ' . \Gaufrette\Util\Path::dirname($file)); |
|
| 124 | + $lines = ftp_rawlist($this->getConnection(), '-al '.\Gaufrette\Util\Path::dirname($file)); |
|
| 125 | 125 | |
| 126 | 126 | if (false === $lines) { |
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $pattern = '{(?<!->) ' . preg_quote(basename($file)) . '( -> |$)}m'; |
|
| 130 | + $pattern = '{(?<!->) '.preg_quote(basename($file)).'( -> |$)}m'; |
|
| 131 | 131 | foreach ($lines as $line) { |
| 132 | 132 | if (preg_match($pattern, $line)) { |
| 133 | 133 | return true; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 235 | 235 | |
| 236 | 236 | $items = $this->parseRawlist( |
| 237 | - ftp_rawlist($this->getConnection(), '-al ' . $this->directory . $directory) ?: [] |
|
| 237 | + ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: [] |
|
| 238 | 238 | ); |
| 239 | 239 | |
| 240 | 240 | $fileData = $dirs = []; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | $item = [ |
| 247 | 247 | 'name' => $itemData['name'], |
| 248 | - 'path' => trim(($directory ? $directory . '/' : '') . $itemData['name'], '/'), |
|
| 248 | + 'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'), |
|
| 249 | 249 | 'time' => $itemData['time'], |
| 250 | 250 | 'size' => $itemData['size'], |
| 251 | 251 | ]; |
@@ -358,8 +358,8 @@ discard block |
||
| 358 | 358 | private function createConnectionUrl() |
| 359 | 359 | { |
| 360 | 360 | $url = $this->ssl ? 'ftps://' : 'ftp://'; |
| 361 | - $url .= $this->username . ':' . $this->password . '@' . $this->host; |
|
| 362 | - $url .= $this->port ? ':' . $this->port : ''; |
|
| 361 | + $url .= $this->username.':'.$this->password.'@'.$this->host; |
|
| 362 | + $url .= $this->port ? ':'.$this->port : ''; |
|
| 363 | 363 | |
| 364 | 364 | return $url; |
| 365 | 365 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | // Build the FTP URL that will be used to check if the path is a directory or not |
| 396 | 396 | $url = $this->createConnectionUrl(); |
| 397 | - return @is_dir($url . $directory); |
|
| 397 | + return @is_dir($url.$directory); |
|
| 398 | 398 | } |
| 399 | 399 | } |
| 400 | 400 | |
@@ -402,13 +402,13 @@ discard block |
||
| 402 | 402 | { |
| 403 | 403 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
| 404 | 404 | |
| 405 | - $lines = ftp_rawlist($this->getConnection(), '-alR ' . $this->directory . $directory); |
|
| 405 | + $lines = ftp_rawlist($this->getConnection(), '-alR '.$this->directory.$directory); |
|
| 406 | 406 | |
| 407 | 407 | if (false === $lines) { |
| 408 | 408 | return ['keys' => [], 'dirs' => []]; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | - $regexDir = '/' . preg_quote($this->directory . $directory, '/') . '\/?(.+):$/u'; |
|
| 411 | + $regexDir = '/'.preg_quote($this->directory.$directory, '/').'\/?(.+):$/u'; |
|
| 412 | 412 | $regexItem = '/^(?:([d\-\d])\S+)\s+\S+(?:(?:\s+\S+){5})?\s+(\S+)\s+(.+?)$/'; |
| 413 | 413 | |
| 414 | 414 | $prevLine = null; |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | continue; |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | - $path = ltrim($directory . '/' . $name, '/'); |
|
| 435 | + $path = ltrim($directory.'/'.$name, '/'); |
|
| 436 | 436 | |
| 437 | 437 | if ('d' === $tokens[1] || '<dir>' === $tokens[2]) { |
| 438 | 438 | $keys['dirs'][] = $path; |
@@ -472,13 +472,13 @@ discard block |
||
| 472 | 472 | $infos = preg_split("/[\s]+/", $line, 9); |
| 473 | 473 | |
| 474 | 474 | if ($this->isLinuxListing($infos)) { |
| 475 | - $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7] . ' 00:00') : (date('Y') . ' ' . $infos[7]); |
|
| 475 | + $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]); |
|
| 476 | 476 | if ('total' !== $infos[0]) { |
| 477 | 477 | $parsed[] = [ |
| 478 | 478 | 'perms' => $infos[0], |
| 479 | 479 | 'num' => $infos[1], |
| 480 | 480 | 'size' => $infos[4], |
| 481 | - 'time' => strtotime($infos[5] . ' ' . $infos[6] . '. ' . $infos[7]), |
|
| 481 | + 'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]), |
|
| 482 | 482 | 'name' => $infos[8], |
| 483 | 483 | ]; |
| 484 | 484 | } |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | 'perms' => $isDir ? 'd' : '-', |
| 489 | 489 | 'num' => '', |
| 490 | 490 | 'size' => $isDir ? '' : $infos[2], |
| 491 | - 'time' => strtotime($infos[0] . ' ' . $infos[1]), |
|
| 491 | + 'time' => strtotime($infos[0].' '.$infos[1]), |
|
| 492 | 492 | 'name' => $infos[3], |
| 493 | 493 | ]; |
| 494 | 494 | } |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | */ |
| 505 | 505 | private function computePath($key) |
| 506 | 506 | { |
| 507 | - return rtrim($this->directory, '/') . '/' . $key; |
|
| 507 | + return rtrim($this->directory, '/').'/'.$key; |
|
| 508 | 508 | } |
| 509 | 509 | |
| 510 | 510 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $this->ensureBucketExists(); |
| 107 | 107 | $options = $this->getOptions( |
| 108 | 108 | $targetKey, |
| 109 | - ['CopySource' => $this->bucket . '/' . $this->computePath($sourceKey)] |
|
| 109 | + ['CopySource' => $this->bucket.'/'.$this->computePath($sourceKey)] |
|
| 110 | 110 | ); |
| 111 | 111 | |
| 112 | 112 | try { |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | { |
| 248 | 248 | $result = $this->service->listObjectsV2([ |
| 249 | 249 | 'Bucket' => $this->bucket, |
| 250 | - 'Prefix' => rtrim($this->computePath($key), '/') . '/', |
|
| 250 | + 'Prefix' => rtrim($this->computePath($key), '/').'/', |
|
| 251 | 251 | 'MaxKeys' => 1, |
| 252 | 252 | ]); |
| 253 | 253 | |