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
}
/**
* @return MongoDB\Driver\CursorId
* @return \MongoDB\Driver\CursorId
*/
public function getCursorId()
{
......@@ -143,8 +143,8 @@ class ChangeStream implements Iterator
if ($document === null) {
throw new ResumeTokenException("Cannot extract a resumeToken from an empty document");
}
if ($document instanceof Serializable) {
return $this->extractResumeToken($document->bsonSerialize());
if ($document instanceof \Serializable) {
$this->extractResumeToken($document->bsonSerialize());
}
if (isset($document->_id)) {
$this->resumeToken = is_array($document) ? $document['_id'] : $document->_id;
......
......@@ -17,6 +17,7 @@
namespace MongoDB\GridFS;
use MongoDB\Collection;
use MongoDB\Driver\Cursor;
use MongoDB\Driver\Manager;
use MongoDB\Driver\ReadConcern;
......
......@@ -175,7 +175,7 @@ class ReadableStream
public function seek($offset)
{
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
......
......@@ -41,7 +41,7 @@ class StreamWrapper
/**
* Return the stream's file document.
*
* @return stdClass
* @return \stdClass
*/
public function getFile()
{
......
......@@ -141,7 +141,7 @@ class WritableStream
/**
* Return the stream's file document.
*
* @return stdClass
* @return \stdClass
*/
public function getFile()
{
......
......@@ -77,7 +77,7 @@ class MapReduceResult implements IteratorAggregate
* Return the mapReduce results as a Traversable.
*
* @see http://php.net/iteratoraggregate.getiterator
* @return Traversable
* @return \Traversable
*/
public function getIterator()
{
......
......@@ -243,7 +243,7 @@ class BulkWrite implements Executable
$this->isArrayFiltersUsed = true;
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
/**
* Create the aggregate pipeline with the changeStream command.
*
* @return Command
* @return \MongoDB\Driver\Command
*/
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