@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Gaufrette\Adapter; |
| 4 | 4 | |
| 5 | -use Gaufrette\File; |
|
| 6 | 5 | use Gaufrette\Adapter; |
| 7 | 6 | use Gaufrette\Adapter\InMemory as InMemoryAdapter; |
| 8 | 7 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * @deprecated The Cache adapter is deprecated since version 0.4 and will be removed in 1.0. |
| 17 | 17 | */ |
| 18 | 18 | class Cache implements Adapter, |
| 19 | - MetadataSupporter |
|
| 19 | + MetadataSupporter |
|
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | 22 | * @var Adapter |
@@ -152,6 +152,10 @@ |
||
| 152 | 152 | return false; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | + /** |
|
| 156 | + * @param string $key |
|
| 157 | + * @param string $column |
|
| 158 | + */ |
|
| 155 | 159 | private function getColumnValue($key, $column) |
| 156 | 160 | { |
| 157 | 161 | $value = $this->connection->fetchColumn( |
@@ -15,8 +15,8 @@ |
||
| 15 | 15 | * @author Leszek Prabucki <[email protected]> |
| 16 | 16 | */ |
| 17 | 17 | class DoctrineDbal implements Adapter, |
| 18 | - ChecksumCalculator, |
|
| 19 | - ListKeysAware |
|
| 18 | + ChecksumCalculator, |
|
| 19 | + ListKeysAware |
|
| 20 | 20 | { |
| 21 | 21 | protected $connection; |
| 22 | 22 | protected $table; |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | |
| 184 | 184 | return array( |
| 185 | 185 | 'dirs' => array(), |
| 186 | - 'keys' => array_map(function ($value) { |
|
| 186 | + 'keys' => array_map(function($value) { |
|
| 187 | 187 | return $value['_key']; |
| 188 | 188 | }, |
| 189 | 189 | $keys), |
@@ -162,6 +162,9 @@ |
||
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | + /** |
|
| 166 | + * @param string $key |
|
| 167 | + */ |
|
| 165 | 168 | private function getDropboxMetadata($key) |
| 166 | 169 | { |
| 167 | 170 | try { |
@@ -349,6 +349,9 @@ |
||
| 349 | 349 | } |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | + /** |
|
| 353 | + * @param string $key |
|
| 354 | + */ |
|
| 352 | 355 | protected function computePath($key) |
| 353 | 356 | { |
| 354 | 357 | if (empty($this->options['directory'])) { |
@@ -187,6 +187,10 @@ discard block |
||
| 187 | 187 | $this->initialized = true; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | + /** |
|
| 191 | + * @param string|null $directory |
|
| 192 | + * @param boolean $create |
|
| 193 | + */ |
|
| 190 | 194 | protected function ensureDirectoryExists($directory, $create) |
| 191 | 195 | { |
| 192 | 196 | $pwd = $this->sftp->pwd(); |
@@ -201,6 +205,9 @@ discard block |
||
| 201 | 205 | } |
| 202 | 206 | } |
| 203 | 207 | |
| 208 | + /** |
|
| 209 | + * @param string $key |
|
| 210 | + */ |
|
| 204 | 211 | protected function computePath($key) |
| 205 | 212 | { |
| 206 | 213 | return $this->directory.'/'.ltrim($key, '/'); |
@@ -8,8 +8,8 @@ |
||
| 8 | 8 | use Gaufrette\File; |
| 9 | 9 | |
| 10 | 10 | class PhpseclibSftp implements Adapter, |
| 11 | - FileFactory, |
|
| 12 | - ListKeysAware |
|
| 11 | + FileFactory, |
|
| 12 | + ListKeysAware |
|
| 13 | 13 | { |
| 14 | 14 | protected $sftp; |
| 15 | 15 | protected $directory; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @author Daniel Richter <[email protected]> |
| 19 | 19 | */ |
| 20 | 20 | class OpenCloud implements Adapter, |
| 21 | - ChecksumCalculator |
|
| 21 | + ChecksumCalculator |
|
| 22 | 22 | { |
| 23 | 23 | /** |
| 24 | 24 | * @var Service |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @param string $key |
| 86 | 86 | * |
| 87 | - * @return string|bool if cannot read content |
|
| 87 | + * @return string if cannot read content |
|
| 88 | 88 | */ |
| 89 | 89 | public function read($key) |
| 90 | 90 | { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | * |
| 157 | 157 | * @param string $key |
| 158 | 158 | * |
| 159 | - * @return int|bool An UNIX like timestamp or false |
|
| 159 | + * @return string|false An UNIX like timestamp or false |
|
| 160 | 160 | */ |
| 161 | 161 | public function mtime($key) |
| 162 | 162 | { |
@@ -15,10 +15,10 @@ |
||
| 15 | 15 | * @author Leszek Prabucki <[email protected]> |
| 16 | 16 | */ |
| 17 | 17 | class Local implements Adapter, |
| 18 | - StreamFactory, |
|
| 19 | - ChecksumCalculator, |
|
| 20 | - SizeCalculator, |
|
| 21 | - MimeTypeProvider |
|
| 18 | + StreamFactory, |
|
| 19 | + ChecksumCalculator, |
|
| 20 | + SizeCalculator, |
|
| 21 | + MimeTypeProvider |
|
| 22 | 22 | { |
| 23 | 23 | protected $directory; |
| 24 | 24 | private $create; |
@@ -167,36 +167,36 @@ |
||
| 167 | 167 | |
| 168 | 168 | if (true !== ($resultCode = $this->zipArchive->open($this->zipFile, ZipArchive::CREATE))) { |
| 169 | 169 | switch ($resultCode) { |
| 170 | - case ZipArchive::ER_EXISTS: |
|
| 171 | - $errMsg = 'File already exists.'; |
|
| 172 | - break; |
|
| 173 | - case ZipArchive::ER_INCONS: |
|
| 174 | - $errMsg = 'Zip archive inconsistent.'; |
|
| 175 | - break; |
|
| 176 | - case ZipArchive::ER_INVAL: |
|
| 177 | - $errMsg = 'Invalid argument.'; |
|
| 178 | - break; |
|
| 179 | - case ZipArchive::ER_MEMORY: |
|
| 180 | - $errMsg = 'Malloc failure.'; |
|
| 181 | - break; |
|
| 182 | - case ZipArchive::ER_NOENT: |
|
| 183 | - $errMsg = 'Invalid argument.'; |
|
| 184 | - break; |
|
| 185 | - case ZipArchive::ER_NOZIP: |
|
| 186 | - $errMsg = 'Not a zip archive.'; |
|
| 187 | - break; |
|
| 188 | - case ZipArchive::ER_OPEN: |
|
| 189 | - $errMsg = 'Can\'t open file.'; |
|
| 190 | - break; |
|
| 191 | - case ZipArchive::ER_READ: |
|
| 192 | - $errMsg = 'Read error.'; |
|
| 193 | - break; |
|
| 194 | - case ZipArchive::ER_SEEK; |
|
| 195 | - $errMsg = 'Seek error.'; |
|
| 196 | - break; |
|
| 197 | - default: |
|
| 198 | - $errMsg = 'Unknown error.'; |
|
| 199 | - break; |
|
| 170 | + case ZipArchive::ER_EXISTS: |
|
| 171 | + $errMsg = 'File already exists.'; |
|
| 172 | + break; |
|
| 173 | + case ZipArchive::ER_INCONS: |
|
| 174 | + $errMsg = 'Zip archive inconsistent.'; |
|
| 175 | + break; |
|
| 176 | + case ZipArchive::ER_INVAL: |
|
| 177 | + $errMsg = 'Invalid argument.'; |
|
| 178 | + break; |
|
| 179 | + case ZipArchive::ER_MEMORY: |
|
| 180 | + $errMsg = 'Malloc failure.'; |
|
| 181 | + break; |
|
| 182 | + case ZipArchive::ER_NOENT: |
|
| 183 | + $errMsg = 'Invalid argument.'; |
|
| 184 | + break; |
|
| 185 | + case ZipArchive::ER_NOZIP: |
|
| 186 | + $errMsg = 'Not a zip archive.'; |
|
| 187 | + break; |
|
| 188 | + case ZipArchive::ER_OPEN: |
|
| 189 | + $errMsg = 'Can\'t open file.'; |
|
| 190 | + break; |
|
| 191 | + case ZipArchive::ER_READ: |
|
| 192 | + $errMsg = 'Read error.'; |
|
| 193 | + break; |
|
| 194 | + case ZipArchive::ER_SEEK; |
|
| 195 | + $errMsg = 'Seek error.'; |
|
| 196 | + break; |
|
| 197 | + default: |
|
| 198 | + $errMsg = 'Unknown error.'; |
|
| 199 | + break; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | throw new \RuntimeException(sprintf('%s', $errMsg)); |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | * Returns the stat of a file in the zip archive |
| 136 | 136 | * (name, index, crc, mtime, compression size, compression method, filesize). |
| 137 | 137 | * |
| 138 | - * @param $key |
|
| 138 | + * @param string $key |
|
| 139 | 139 | * |
| 140 | 140 | * @return array|bool |
| 141 | 141 | */ |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | $blobList = $this->blobProxy->listBlobs($this->containerName); |
| 208 | 208 | |
| 209 | 209 | return array_map( |
| 210 | - function ($blob) { |
|
| 210 | + function($blob) { |
|
| 211 | 211 | return $blob->getName(); |
| 212 | 212 | }, |
| 213 | 213 | $blobList->getBlobs() |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @author Paweł Czyżewski <[email protected]> |
| 19 | 19 | */ |
| 20 | 20 | class AzureBlobStorage implements Adapter, |
| 21 | - MetadataSupporter |
|
| 21 | + MetadataSupporter |
|
| 22 | 22 | { |
| 23 | 23 | /** |
| 24 | 24 | * Error constants. |