Commit b8e07dba authored by Gabriel Caruso's avatar Gabriel Caruso Committed by Jeremy Mikola

Fixes from PHPStan level 0

parent d3a3c4e8
...@@ -66,7 +66,7 @@ class ChangeStream implements Iterator ...@@ -66,7 +66,7 @@ class ChangeStream implements Iterator
} }
/** /**
* @return MongoDB\Driver\CursorId * @return \MongoDB\Driver\CursorId
*/ */
public function getCursorId() public function getCursorId()
{ {
...@@ -143,8 +143,8 @@ class ChangeStream implements Iterator ...@@ -143,8 +143,8 @@ class ChangeStream implements Iterator
if ($document === null) { if ($document === null) {
throw new ResumeTokenException("Cannot extract a resumeToken from an empty document"); throw new ResumeTokenException("Cannot extract a resumeToken from an empty document");
} }
if ($document instanceof Serializable) { if ($document instanceof \Serializable) {
return $this->extractResumeToken($document->bsonSerialize()); $this->extractResumeToken($document->bsonSerialize());
} }
if (isset($document->_id)) { if (isset($document->_id)) {
$this->resumeToken = is_array($document) ? $document['_id'] : $document->_id; $this->resumeToken = is_array($document) ? $document['_id'] : $document->_id;
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
namespace MongoDB\GridFS; namespace MongoDB\GridFS;
use MongoDB\Collection;
use MongoDB\Driver\Cursor; use MongoDB\Driver\Cursor;
use MongoDB\Driver\Manager; use MongoDB\Driver\Manager;
use MongoDB\Driver\ReadConcern; use MongoDB\Driver\ReadConcern;
......
...@@ -132,7 +132,7 @@ class ReadableStream ...@@ -132,7 +132,7 @@ class ReadableStream
* *
* Note: this method may return a string smaller than the requested length * Note: this method may return a string smaller than the requested length
* if data is not available to be read. * if data is not available to be read.
* *
* @param integer $length Number of bytes to read * @param integer $length Number of bytes to read
* @return string * @return string
* @throws InvalidArgumentException if $length is negative * @throws InvalidArgumentException if $length is negative
...@@ -175,7 +175,7 @@ class ReadableStream ...@@ -175,7 +175,7 @@ class ReadableStream
public function seek($offset) public function seek($offset)
{ {
if ($offset < 0 || $offset > $this->file->length) { if ($offset < 0 || $offset > $this->file->length) {
throw new InvalidArgumentException(sprintf('$offset must be >= 0 and <= %d; given: %d', $length, $offset)); throw new InvalidArgumentException(sprintf('$offset must be >= 0 and <= %d; given: %d', $this->file->length, $offset));
} }
/* Compute the offsets for the chunk and buffer (i.e. chunk data) from /* Compute the offsets for the chunk and buffer (i.e. chunk data) from
......
...@@ -41,7 +41,7 @@ class StreamWrapper ...@@ -41,7 +41,7 @@ class StreamWrapper
/** /**
* Return the stream's file document. * Return the stream's file document.
* *
* @return stdClass * @return \stdClass
*/ */
public function getFile() public function getFile()
{ {
...@@ -117,7 +117,7 @@ class StreamWrapper ...@@ -117,7 +117,7 @@ class StreamWrapper
* *
* Note: this method may return a string smaller than the requested length * Note: this method may return a string smaller than the requested length
* if data is not available to be read. * if data is not available to be read.
* *
* @see http://php.net/manual/en/streamwrapper.stream-read.php * @see http://php.net/manual/en/streamwrapper.stream-read.php
* @param integer $length Number of bytes to read * @param integer $length Number of bytes to read
* @return string * @return string
......
...@@ -48,7 +48,7 @@ class WritableStream ...@@ -48,7 +48,7 @@ class WritableStream
* *
* * _id (mixed): File document identifier. Defaults to a new ObjectId. * * _id (mixed): File document identifier. Defaults to a new ObjectId.
* *
* * aliases (array of strings): DEPRECATED An array of aliases. * * aliases (array of strings): DEPRECATED An array of aliases.
* Applications wishing to store aliases should add an aliases field to * Applications wishing to store aliases should add an aliases field to
* the metadata document instead. * the metadata document instead.
* *
...@@ -141,7 +141,7 @@ class WritableStream ...@@ -141,7 +141,7 @@ class WritableStream
/** /**
* Return the stream's file document. * Return the stream's file document.
* *
* @return stdClass * @return \stdClass
*/ */
public function getFile() public function getFile()
{ {
......
...@@ -77,7 +77,7 @@ class MapReduceResult implements IteratorAggregate ...@@ -77,7 +77,7 @@ class MapReduceResult implements IteratorAggregate
* Return the mapReduce results as a Traversable. * Return the mapReduce results as a Traversable.
* *
* @see http://php.net/iteratoraggregate.getiterator * @see http://php.net/iteratoraggregate.getiterator
* @return Traversable * @return \Traversable
*/ */
public function getIterator() public function getIterator()
{ {
......
...@@ -243,7 +243,7 @@ class BulkWrite implements Executable ...@@ -243,7 +243,7 @@ class BulkWrite implements Executable
$this->isArrayFiltersUsed = true; $this->isArrayFiltersUsed = true;
if ( ! is_array($args[2]['arrayFilters'])) { if ( ! is_array($args[2]['arrayFilters'])) {
throw InvalidArgumentException::InvalidType(sprintf('$operations[%d]["%s"][2]["arrayFilters"]', $i, $type), $args[2]['arrayFilters'], 'array'); throw InvalidArgumentException::invalidType(sprintf('$operations[%d]["%s"][2]["arrayFilters"]', $i, $type), $args[2]['arrayFilters'], 'array');
} }
} }
......
...@@ -165,7 +165,7 @@ class ChangeStream implements Executable ...@@ -165,7 +165,7 @@ class ChangeStream implements Executable
/** /**
* Create the aggregate pipeline with the changeStream command. * Create the aggregate pipeline with the changeStream command.
* *
* @return Command * @return \MongoDB\Driver\Command
*/ */
private function createCommand() private function createCommand()
{ {
......
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