@@ -138,7 +138,7 @@ |
||
138 | 138 | * @param string $key - by default '' |
139 | 139 | * @param int $format - by default APC_ITER_NONE |
140 | 140 | * |
141 | - * @return \APCIterator |
|
141 | + * @return \Traversable |
|
142 | 142 | */ |
143 | 143 | protected function getCachedKeysIterator($key = '', $format = APC_ITER_NONE) |
144 | 144 | { |
@@ -213,7 +213,7 @@ |
||
213 | 213 | /** |
214 | 214 | * @param string $path |
215 | 215 | * |
216 | - * @return mixed |
|
216 | + * @return boolean |
|
217 | 217 | */ |
218 | 218 | public function unlink($path) |
219 | 219 | { |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | * @author Antoine Hérault <[email protected]> |
13 | 13 | */ |
14 | 14 | class Ftp implements Adapter, |
15 | - FileFactory, |
|
16 | - ListKeysAware, |
|
17 | - SizeCalculator |
|
15 | + FileFactory, |
|
16 | + ListKeysAware, |
|
17 | + SizeCalculator |
|
18 | 18 | { |
19 | 19 | protected $connection = null; |
20 | 20 | protected $directory; |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | $this->fileData = array_merge($fileData, $this->fileData); |
264 | 264 | |
265 | 265 | return array( |
266 | - 'keys' => array_keys($fileData), |
|
267 | - 'dirs' => $dirs, |
|
266 | + 'keys' => array_keys($fileData), |
|
267 | + 'dirs' => $dirs, |
|
268 | 268 | ); |
269 | 269 | } |
270 | 270 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $this->ensureDirectoryExists($this->directory, $this->create); |
125 | 125 | |
126 | 126 | $file = $this->computePath($key); |
127 | - $lines = ftp_rawlist($this->getConnection(), '-al ' . \Gaufrette\Util\Path::dirname($file)); |
|
127 | + $lines = ftp_rawlist($this->getConnection(), '-al '.\Gaufrette\Util\Path::dirname($file)); |
|
128 | 128 | |
129 | 129 | if (false === $lines) { |
130 | 130 | return false; |
@@ -361,8 +361,8 @@ discard block |
||
361 | 361 | private function createConnectionUrl() |
362 | 362 | { |
363 | 363 | $url = $this->ssl ? 'sftp://' : 'ftp://'; |
364 | - $url .= $this->username . ':' . $this->password . '@' . $this->host; |
|
365 | - $url .= $this->port ? ':' . $this->port : ''; |
|
364 | + $url .= $this->username.':'.$this->password.'@'.$this->host; |
|
365 | + $url .= $this->port ? ':'.$this->port : ''; |
|
366 | 366 | |
367 | 367 | return $url; |
368 | 368 | } |
@@ -384,18 +384,18 @@ discard block |
||
384 | 384 | |
385 | 385 | // change directory again to return in the base directory |
386 | 386 | ftp_chdir($this->getConnection(), $this->directory); |
387 | - } catch(\Exception $e) { |
|
387 | + } catch (\Exception $e) { |
|
388 | 388 | |
389 | 389 | // Build the FTP URL that will be used to check if the path is a directory or not |
390 | 390 | $url = $this->createConnectionUrl(); |
391 | 391 | |
392 | 392 | // is_dir is only available in passive mode. |
393 | 393 | // See https://php.net/manual/en/wrappers.ftp.php for more details. |
394 | - if(!$this->passive) { |
|
394 | + if (!$this->passive) { |
|
395 | 395 | throw new \BadFunctionCallException('is_dir can only be used in passive mode.'); |
396 | 396 | } |
397 | 397 | |
398 | - if (!@is_dir($url . $directory)) { |
|
398 | + if (!@is_dir($url.$directory)) { |
|
399 | 399 | return false; |
400 | 400 | } |
401 | 401 | } |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | } |
584 | 584 | |
585 | 585 | // enable utf8 mode if configured |
586 | - if($this->utf8 == true) { |
|
586 | + if ($this->utf8 == true) { |
|
587 | 587 | ftp_raw($this->connection, "OPTS UTF8 ON"); |
588 | 588 | } |
589 | 589 |
@@ -287,6 +287,9 @@ |
||
287 | 287 | return true; |
288 | 288 | } |
289 | 289 | |
290 | + /** |
|
291 | + * @param string $key |
|
292 | + */ |
|
290 | 293 | protected function getOptions($key, array $options = []) |
291 | 294 | { |
292 | 295 | $options['ACL'] = $this->options['acl']; |
@@ -12,10 +12,10 @@ |
||
12 | 12 | * @author Michael Dowling <[email protected]> |
13 | 13 | */ |
14 | 14 | class AwsS3 implements Adapter, |
15 | - MetadataSupporter, |
|
16 | - ListKeysAware, |
|
17 | - SizeCalculator, |
|
18 | - MimeTypeProvider |
|
15 | + MetadataSupporter, |
|
16 | + ListKeysAware, |
|
17 | + SizeCalculator, |
|
18 | + MimeTypeProvider |
|
19 | 19 | { |
20 | 20 | /** @var S3Client */ |
21 | 21 | protected $service; |
@@ -186,6 +186,9 @@ |
||
186 | 186 | return $this->users; |
187 | 187 | } |
188 | 188 | |
189 | + /** |
|
190 | + * @param string $key |
|
191 | + */ |
|
189 | 192 | private function updateAcl($key) |
190 | 193 | { |
191 | 194 | $response = $this->s3->set_object_acl($this->bucketName, $key, $this->getAcl()); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * @deprecated The AclAwareAmazonS3 adapter is deprecated since version 0.4 and will be removed in 1.0. Use the AwsS3 adapter instead. |
20 | 20 | */ |
21 | 21 | class AclAwareAmazonS3 implements Adapter, |
22 | - MetadataSupporter |
|
22 | + MetadataSupporter |
|
23 | 23 | { |
24 | 24 | protected $delegate; |
25 | 25 | protected $s3; |
@@ -18,7 +18,7 @@ |
||
18 | 18 | * @deprecated The AmazonS3 adapter is deprecated since version 0.4 and will be removed in 1.0. Use the AwsS3 adapter instead. |
19 | 19 | */ |
20 | 20 | class AmazonS3 implements Adapter, |
21 | - MetadataSupporter |
|
21 | + MetadataSupporter |
|
22 | 22 | { |
23 | 23 | protected $service; |
24 | 24 | protected $bucket; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * @deprecated The Sftp adapter is deprecated since version 0.4 and will be removed in 1.0. |
12 | 12 | */ |
13 | 13 | class Sftp implements Adapter, |
14 | - ChecksumCalculator |
|
14 | + ChecksumCalculator |
|
15 | 15 | { |
16 | 16 | protected $sftp; |
17 | 17 | protected $directory; |
@@ -512,10 +512,10 @@ |
||
512 | 512 | { |
513 | 513 | $blobList = $this->blobProxy->listBlobs($containerName); |
514 | 514 | return array_map( |
515 | - function (Blob $blob) use ($prefix) { |
|
515 | + function(Blob $blob) use ($prefix) { |
|
516 | 516 | $name = $blob->getName(); |
517 | 517 | if (null !== $prefix) { |
518 | - $name = $prefix .'/'. $name; |
|
518 | + $name = $prefix.'/'.$name; |
|
519 | 519 | } |
520 | 520 | return $name; |
521 | 521 | }, |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | } |
467 | 467 | |
468 | 468 | /** |
469 | - * @param string|resource $content |
|
469 | + * @param string $content |
|
470 | 470 | * |
471 | 471 | * @return string |
472 | 472 | */ |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | /** |
485 | 485 | * @param string $key |
486 | 486 | * |
487 | - * @return array |
|
487 | + * @return string[] |
|
488 | 488 | * @throws \InvalidArgumentException |
489 | 489 | */ |
490 | 490 | private function tokenizeKey($key) |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | |
509 | 509 | /** |
510 | 510 | * @param string $containerName |
511 | - * @param null $prefix |
|
511 | + * @param string $prefix |
|
512 | 512 | * |
513 | 513 | * @return array |
514 | 514 | */ |
@@ -21,9 +21,9 @@ |
||
21 | 21 | * @author Paweł Czyżewski <[email protected]> |
22 | 22 | */ |
23 | 23 | class AzureBlobStorage implements Adapter, |
24 | - MetadataSupporter, |
|
25 | - SizeCalculator, |
|
26 | - ChecksumCalculator |
|
24 | + MetadataSupporter, |
|
25 | + SizeCalculator, |
|
26 | + ChecksumCalculator |
|
27 | 27 | |
28 | 28 | { |
29 | 29 | /** |
@@ -241,6 +241,7 @@ |
||
241 | 241 | |
242 | 242 | /** |
243 | 243 | * {@inheritdoc} |
244 | + * @param string $key |
|
244 | 245 | */ |
245 | 246 | public function createFile($key) |
246 | 247 | { |