@@ -143,7 +143,7 @@ |
||
143 | 143 | public function keys() |
144 | 144 | { |
145 | 145 | $objectList = $this->getContainer()->objectList(); |
146 | - $keys = array (); |
|
146 | + $keys = array(); |
|
147 | 147 | |
148 | 148 | while ($object = $objectList->next()) { |
149 | 149 | $keys[] = $object->getName(); |
@@ -205,7 +205,7 @@ |
||
205 | 205 | { |
206 | 206 | $this->ensureDirectoryExists($this->directory, $this->create); |
207 | 207 | |
208 | - return $this->normalizePath($this->directory . '/' . $key); |
|
208 | + return $this->normalizePath($this->directory.'/'.$key); |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | /** |
@@ -186,7 +186,7 @@ |
||
186 | 186 | |
187 | 187 | return array( |
188 | 188 | 'dirs' => array(), |
189 | - 'keys' => array_map(function ($value) { |
|
189 | + 'keys' => array_map(function($value) { |
|
190 | 190 | return $value['_key']; |
191 | 191 | }, |
192 | 192 | $keys) |
@@ -131,7 +131,7 @@ |
||
131 | 131 | public function keys() |
132 | 132 | { |
133 | 133 | $metadata = $this->client->getMetaData('/', true); |
134 | - if (! isset($metadata['contents'])) { |
|
134 | + if (!isset($metadata['contents'])) { |
|
135 | 135 | return array(); |
136 | 136 | } |
137 | 137 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->ensureDirectoryExists($this->directory, $this->create); |
124 | 124 | |
125 | 125 | $file = $this->computePath($key); |
126 | - $lines = ftp_rawlist($this->getConnection(), '-al ' . str_replace('\\', '/', dirname($file))); |
|
126 | + $lines = ftp_rawlist($this->getConnection(), '-al '.str_replace('\\', '/', dirname($file))); |
|
127 | 127 | |
128 | 128 | if (false === $lines) { |
129 | 129 | return false; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
237 | 237 | |
238 | 238 | $items = $this->parseRawlist( |
239 | - ftp_rawlist($this->getConnection(), '-al ' . $this->directory . $directory ) ? : array() |
|
239 | + ftp_rawlist($this->getConnection(), '-al '.$this->directory.$directory) ?: array() |
|
240 | 240 | ); |
241 | 241 | |
242 | 242 | $fileData = $dirs = array(); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | $item = array( |
250 | 250 | 'name' => $itemData['name'], |
251 | - 'path' => trim(($directory ? $directory . '/' : '') . $itemData['name'], '/'), |
|
251 | + 'path' => trim(($directory ? $directory.'/' : '').$itemData['name'], '/'), |
|
252 | 252 | 'time' => $itemData['time'], |
253 | 253 | 'size' => $itemData['size'], |
254 | 254 | ); |
@@ -360,13 +360,13 @@ discard block |
||
360 | 360 | { |
361 | 361 | $directory = preg_replace('/^[\/]*([^\/].*)$/', '/$1', $directory); |
362 | 362 | |
363 | - $lines = ftp_rawlist($this->getConnection(), '-alR '. $this->directory . $directory); |
|
363 | + $lines = ftp_rawlist($this->getConnection(), '-alR '.$this->directory.$directory); |
|
364 | 364 | |
365 | 365 | if (false === $lines) { |
366 | 366 | return array('keys' => array(), 'dirs' => array()); |
367 | 367 | } |
368 | 368 | |
369 | - $regexDir = '/'.preg_quote($this->directory . $directory, '/').'\/?(.+):$/u'; |
|
369 | + $regexDir = '/'.preg_quote($this->directory.$directory, '/').'\/?(.+):$/u'; |
|
370 | 370 | $regexItem = '/^(?:([d\-\d])\S+)\s+\S+(?:(?:\s+\S+){5})?\s+(\S+)\s+(.+?)$/'; |
371 | 371 | |
372 | 372 | $prevLine = null; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | continue; |
391 | 391 | } |
392 | 392 | |
393 | - $path = ltrim($directory . '/' . $name, '/'); |
|
393 | + $path = ltrim($directory.'/'.$name, '/'); |
|
394 | 394 | |
395 | 395 | if ('d' === $tokens[1] || '<dir>' === $tokens[2]) { |
396 | 396 | $keys['dirs'][] = $path; |
@@ -430,13 +430,13 @@ discard block |
||
430 | 430 | $infos = preg_split("/[\s]+/", $line, 9); |
431 | 431 | |
432 | 432 | if ($this->isLinuxListing($infos)) { |
433 | - $infos[7] = (strrpos($infos[7], ':') != 2 ) ? ($infos[7] . ' 00:00') : (date('Y') . ' ' . $infos[7]); |
|
433 | + $infos[7] = (strrpos($infos[7], ':') != 2) ? ($infos[7].' 00:00') : (date('Y').' '.$infos[7]); |
|
434 | 434 | if ('total' !== $infos[0]) { |
435 | 435 | $parsed[] = array( |
436 | 436 | 'perms' => $infos[0], |
437 | 437 | 'num' => $infos[1], |
438 | 438 | 'size' => $infos[4], |
439 | - 'time' => strtotime($infos[5] . ' ' . $infos[6] . '. ' . $infos[7]), |
|
439 | + 'time' => strtotime($infos[5].' '.$infos[6].'. '.$infos[7]), |
|
440 | 440 | 'name' => $infos[8] |
441 | 441 | ); |
442 | 442 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | 'perms' => $isDir ? 'd' : '-', |
447 | 447 | 'num' => '', |
448 | 448 | 'size' => $isDir ? '' : $infos[2], |
449 | - 'time' => strtotime($infos[0] . ' ' . $infos[1]), |
|
449 | + 'time' => strtotime($infos[0].' '.$infos[1]), |
|
450 | 450 | 'name' => $infos[3] |
451 | 451 | ); |
452 | 452 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | */ |
463 | 463 | private function computePath($key) |
464 | 464 | { |
465 | - return rtrim($this->directory, '/') . '/' . $key; |
|
465 | + return rtrim($this->directory, '/').'/'.$key; |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | if (!$this->ssl) { |
502 | 502 | $this->connection = ftp_connect($this->host, $this->port); |
503 | 503 | } else { |
504 | - if(function_exists('ftp_ssl_connect')) { |
|
504 | + if (function_exists('ftp_ssl_connect')) { |
|
505 | 505 | $this->connection = ftp_ssl_connect($this->host, $this->port); |
506 | 506 | } else { |
507 | 507 | throw new \RuntimeException('This Server Has No SSL-FTP Available.'); |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | throw new \RuntimeException(sprintf('Could not connect to \'%s\' (port: %s).', $this->host, $this->port)); |
512 | 512 | } |
513 | 513 | |
514 | - $username = $this->username ? : 'anonymous'; |
|
515 | - $password = $this->password ? : ''; |
|
514 | + $username = $this->username ?: 'anonymous'; |
|
515 | + $password = $this->password ?: ''; |
|
516 | 516 | |
517 | 517 | // login ftp user |
518 | 518 | if (!@ftp_login($this->connection, $username, $password)) { |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | */ |
262 | 262 | public function isDirectory($key) |
263 | 263 | { |
264 | - if ($this->exists($key . '/')) { |
|
264 | + if ($this->exists($key.'/')) { |
|
265 | 265 | return true; |
266 | 266 | } |
267 | 267 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $this->ensureBucketExists(); |
277 | 277 | |
278 | 278 | $options = array(); |
279 | - if ((string)$prefix != '') { |
|
279 | + if ((string) $prefix != '') { |
|
280 | 280 | $options['prefix'] = $this->computePath($prefix); |
281 | 281 | } elseif (!empty($this->options['directory'])) { |
282 | 282 | $options['prefix'] = $this->options['directory']; |