Commit cc137d46 authored by Jeremy Mikola's avatar Jeremy Mikola

Merge pull request #191

parents 5ffd0503 96f46e03
...@@ -85,10 +85,10 @@ class Bucket ...@@ -85,10 +85,10 @@ class Bucket
* If the files collection document is not found, this method will still * If the files collection document is not found, this method will still
* attempt to delete orphaned chunks. * attempt to delete orphaned chunks.
* *
* @param ObjectId $id ObjectId of the file * @param mixed $id File ID
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
public function delete(ObjectId $id) public function delete($id)
{ {
$file = $this->collectionWrapper->findFileById($id); $file = $this->collectionWrapper->findFileById($id);
$this->collectionWrapper->deleteFileAndChunksById($id); $this->collectionWrapper->deleteFileAndChunksById($id);
...@@ -101,11 +101,11 @@ class Bucket ...@@ -101,11 +101,11 @@ class Bucket
/** /**
* Writes the contents of a GridFS file to a writable stream. * Writes the contents of a GridFS file to a writable stream.
* *
* @param ObjectId $id ObjectId of the file * @param mixed $id File ID
* @param resource $destination Writable Stream * @param resource $destination Writable Stream
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
public function downloadToStream(ObjectId $id, $destination) public function downloadToStream($id, $destination)
{ {
$file = $this->collectionWrapper->findFileById($id); $file = $this->collectionWrapper->findFileById($id);
...@@ -136,7 +136,7 @@ class Bucket ...@@ -136,7 +136,7 @@ class Bucket
* * -2 = the second most recent revision * * -2 = the second most recent revision
* * -1 = the most recent revision * * -1 = the most recent revision
* *
* @param string $filename File name * @param string $filename Filename
* @param resource $destination Writable Stream * @param resource $destination Writable Stream
* @param array $options Download options * @param array $options Download options
* @throws FileNotFoundException * @throws FileNotFoundException
...@@ -208,11 +208,11 @@ class Bucket ...@@ -208,11 +208,11 @@ class Bucket
/** /**
* Opens a readable stream for reading a GridFS file. * Opens a readable stream for reading a GridFS file.
* *
* @param ObjectId $id ObjectId of the file * @param mixed $id File ID
* @return resource * @return resource
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
public function openDownloadStream(ObjectId $id) public function openDownloadStream($id)
{ {
$file = $this->collectionWrapper->findFileById($id); $file = $this->collectionWrapper->findFileById($id);
...@@ -242,7 +242,7 @@ class Bucket ...@@ -242,7 +242,7 @@ class Bucket
* * -2 = the second most recent revision * * -2 = the second most recent revision
* * -1 = the most recent revision * * -1 = the most recent revision
* *
* @param string $filename File name * @param string $filename Filename
* @param array $options Download options * @param array $options Download options
* @return resource * @return resource
* @throws FileNotFoundException * @throws FileNotFoundException
...@@ -268,7 +268,7 @@ class Bucket ...@@ -268,7 +268,7 @@ class Bucket
* * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the
* bucket's chunk size. * bucket's chunk size.
* *
* @param string $filename File name * @param string $filename Filename
* @param array $options Upload options * @param array $options Upload options
* @return resource * @return resource
*/ */
...@@ -291,11 +291,11 @@ class Bucket ...@@ -291,11 +291,11 @@ class Bucket
/** /**
* Renames the GridFS file with the specified ID. * Renames the GridFS file with the specified ID.
* *
* @param ObjectId $id ID of the file to rename * @param mixed $id File ID
* @param string $newFilename New file name * @param string $newFilename New filename
* @throws FileNotFoundException * @throws FileNotFoundException
*/ */
public function rename(ObjectId $id, $newFilename) public function rename($id, $newFilename)
{ {
$updateResult = $this->collectionWrapper->updateFilenameForId($id, $newFilename); $updateResult = $this->collectionWrapper->updateFilenameForId($id, $newFilename);
...@@ -325,10 +325,10 @@ class Bucket ...@@ -325,10 +325,10 @@ class Bucket
* * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the * * chunkSizeBytes (integer): The chunk size in bytes. Defaults to the
* bucket's chunk size. * bucket's chunk size.
* *
* @param string $filename File name * @param string $filename Filename
* @param resource $source Readable stream * @param resource $source Readable stream
* @param array $options Stream options * @param array $options Stream options
* @return ObjectId * @return ObjectId ID of the newly created GridFS file
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function uploadFromStream($filename, $source, array $options = []) public function uploadFromStream($filename, $source, array $options = [])
......
...@@ -48,7 +48,7 @@ class WritableStream ...@@ -48,7 +48,7 @@ class WritableStream
* collection document. * collection document.
* *
* @param CollectionWrapper $collectionWrapper GridFS collection wrapper * @param CollectionWrapper $collectionWrapper GridFS collection wrapper
* @param string $filename File name * @param string $filename Filename
* @param array $options Upload options * @param array $options Upload options
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment