@@ -137,7 +137,7 @@ |
||
137 | 137 | /** |
138 | 138 | * @param string $key - by default '' |
139 | 139 | * @param integer $format - by default APC_ITER_NONE |
140 | - * @return \APCIterator |
|
140 | + * @return \Traversable |
|
141 | 141 | * |
142 | 142 | */ |
143 | 143 | protected function getCachedKeysIterator($key = '', $format = APC_ITER_NONE) |
@@ -272,6 +272,9 @@ discard block |
||
272 | 272 | return true; |
273 | 273 | } |
274 | 274 | |
275 | + /** |
|
276 | + * @param string $key |
|
277 | + */ |
|
275 | 278 | protected function getOptions($key, array $options = array()) |
276 | 279 | { |
277 | 280 | $options['ACL'] = $this->options['acl']; |
@@ -287,6 +290,9 @@ discard block |
||
287 | 290 | return $options; |
288 | 291 | } |
289 | 292 | |
293 | + /** |
|
294 | + * @return string |
|
295 | + */ |
|
290 | 296 | protected function computePath($key) |
291 | 297 | { |
292 | 298 | if (empty($this->options['directory'])) { |
@@ -12,9 +12,9 @@ |
||
12 | 12 | * @author Michael Dowling <[email protected]> |
13 | 13 | */ |
14 | 14 | class AwsS3 implements Adapter, |
15 | - MetadataSupporter, |
|
16 | - ListKeysAware, |
|
17 | - SizeCalculator |
|
15 | + MetadataSupporter, |
|
16 | + ListKeysAware, |
|
17 | + SizeCalculator |
|
18 | 18 | { |
19 | 19 | protected $service; |
20 | 20 | protected $bucket; |
@@ -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 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @author Antoine Hérault <[email protected]> |
14 | 14 | */ |
15 | 15 | class Cache implements Adapter, |
16 | - MetadataSupporter |
|
16 | + MetadataSupporter |
|
17 | 17 | { |
18 | 18 | /** |
19 | 19 | * @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; |
@@ -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) |
@@ -145,6 +145,9 @@ |
||
145 | 145 | return isset($this->metadata[$key]) ? $this->metadata[$key] : array(); |
146 | 146 | } |
147 | 147 | |
148 | + /** |
|
149 | + * @param string $key |
|
150 | + */ |
|
148 | 151 | private function find($key, array $fields = array()) |
149 | 152 | { |
150 | 153 | return $this->gridFS->findOne($key, $fields); |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** |
253 | 253 | * Makes request to MogileFS tracker |
254 | 254 | * |
255 | - * @param cmd Command |
|
255 | + * @param cmd string |
|
256 | 256 | * @param args Array of arguments |
257 | 257 | * @return mixed Array on success, false on failure |
258 | 258 | */ |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | /** |
304 | 304 | * Get file location at server from MogileFS tracker |
305 | 305 | * |
306 | - * @param key File key |
|
306 | + * @param key string key |
|
307 | 307 | * @return mixed Array on success, false on failure |
308 | 308 | */ |
309 | 309 | private function getPaths($key) |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * Sends file to MogileFS tracker |
319 | 319 | * |
320 | 320 | * @param path Save path at server |
321 | - * @param data Data to save |
|
321 | + * @param data string to save |
|
322 | 322 | * @return boolean |
323 | 323 | */ |
324 | 324 | private function putFile($path, $data) |
@@ -89,7 +89,7 @@ |
||
89 | 89 | |
90 | 90 | if ($status) { |
91 | 91 | $params = array('key' => $key, 'class' => $metadata['mogile_class'], 'devid' => $res['devid'], |
92 | - 'fid' => $res['fid'], 'path' => urldecode($res['path']), ); |
|
92 | + 'fid' => $res['fid'], 'path' => urldecode($res['path']),); |
|
93 | 93 | $closeres = $this->doRequest('CREATE_CLOSE', $params); |
94 | 94 | } |
95 | 95 | } |
@@ -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; |
@@ -136,7 +136,7 @@ |
||
136 | 136 | * Returns the stat of a file in the zip archive |
137 | 137 | * (name, index, crc, mtime, compression size, compression method, filesize) |
138 | 138 | * |
139 | - * @param $key |
|
139 | + * @param string $key |
|
140 | 140 | * @return array|bool |
141 | 141 | */ |
142 | 142 | public function getStat($key) |
@@ -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)); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | /** |
269 | 269 | * Gets a new stream instance of the specified file. |
270 | 270 | * |
271 | - * @param $key |
|
271 | + * @param string $key |
|
272 | 272 | * @return Stream|Stream\InMemoryBuffer |
273 | 273 | */ |
274 | 274 | public function createStream($key) |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | /** |
284 | 284 | * Creates a new file in a filesystem. |
285 | 285 | * |
286 | - * @param $key |
|
286 | + * @param string $key |
|
287 | 287 | * @return File |
288 | 288 | */ |
289 | 289 | public function createFile($key) |