@@ -126,6 +126,9 @@ |
||
126 | 126 | ); |
127 | 127 | } |
128 | 128 | |
129 | + /** |
|
130 | + * @param resource $handle |
|
131 | + */ |
|
129 | 132 | private function writeFromRessource($handle) |
130 | 133 | { |
131 | 134 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * @link http://php.net/manual/en/mongogridfs.construct.php |
54 | 54 | * @param MongoDB $db Database |
55 | 55 | * @param string $prefix [optional] <p>Optional collection name prefix.</p> |
56 | - * @param mixed $chunks [optional] |
|
56 | + * @param string $chunks [optional] |
|
57 | 57 | * @return MongoGridFS |
58 | 58 | */ |
59 | 59 | public function __construct(MongoDB $db, $prefix = "fs", $chunks = null) |
@@ -280,6 +280,9 @@ discard block |
||
280 | 280 | $this->createIndex(['filename' => 1, 'uploadDate' => 1]); |
281 | 281 | } |
282 | 282 | |
283 | + /** |
|
284 | + * @param resource $file |
|
285 | + */ |
|
283 | 286 | private function insertChunksFromFile($file, $fileInfo) |
284 | 287 | { |
285 | 288 | $length = $fileInfo['length']; |
@@ -295,6 +298,9 @@ discard block |
||
295 | 298 | } |
296 | 299 | } |
297 | 300 | |
301 | + /** |
|
302 | + * @param resource $file |
|
303 | + */ |
|
298 | 304 | private function calculateMD5($file) |
299 | 305 | { |
300 | 306 | // XXX: this could be really a bad idea with big files... |
@@ -303,6 +309,9 @@ discard block |
||
303 | 309 | return md5($data); |
304 | 310 | } |
305 | 311 | |
312 | + /** |
|
313 | + * @param string $bytes |
|
314 | + */ |
|
306 | 315 | private function insertChunksFromBytes($bytes, $fileInfo) |
307 | 316 | { |
308 | 317 | $length = $fileInfo['length']; |
@@ -316,6 +325,9 @@ discard block |
||
316 | 325 | } |
317 | 326 | } |
318 | 327 | |
328 | + /** |
|
329 | + * @param integer $chunkNumber |
|
330 | + */ |
|
319 | 331 | private function insertChunk($id, $data, $chunkNumber) |
320 | 332 | { |
321 | 333 | $chunk = [ |