Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
b8e07dba
Commit
b8e07dba
authored
Jan 15, 2018
by
Gabriel Caruso
Committed by
Jeremy Mikola
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes from PHPStan level 0
parent
d3a3c4e8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
12 deletions
+13
-12
ChangeStream.php
src/ChangeStream.php
+3
-3
Bucket.php
src/GridFS/Bucket.php
+1
-0
ReadableStream.php
src/GridFS/ReadableStream.php
+2
-2
StreamWrapper.php
src/GridFS/StreamWrapper.php
+2
-2
WritableStream.php
src/GridFS/WritableStream.php
+2
-2
MapReduceResult.php
src/MapReduceResult.php
+1
-1
BulkWrite.php
src/Operation/BulkWrite.php
+1
-1
ChangeStream.php
src/Operation/ChangeStream.php
+1
-1
No files found.
src/ChangeStream.php
View file @
b8e07dba
...
@@ -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
;
...
...
src/GridFS/Bucket.php
View file @
b8e07dba
...
@@ -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
;
...
...
src/GridFS/ReadableStream.php
View file @
b8e07dba
...
@@ -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
...
...
src/GridFS/StreamWrapper.php
View file @
b8e07dba
...
@@ -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
...
...
src/GridFS/WritableStream.php
View file @
b8e07dba
...
@@ -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
()
{
{
...
...
src/MapReduceResult.php
View file @
b8e07dba
...
@@ -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
()
{
{
...
...
src/Operation/BulkWrite.php
View file @
b8e07dba
...
@@ -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
::
I
nvalidType
(
sprintf
(
'$operations[%d]["%s"][2]["arrayFilters"]'
,
$i
,
$type
),
$args
[
2
][
'arrayFilters'
],
'array'
);
throw
InvalidArgumentException
::
i
nvalidType
(
sprintf
(
'$operations[%d]["%s"][2]["arrayFilters"]'
,
$i
,
$type
),
$args
[
2
][
'arrayFilters'
],
'array'
);
}
}
}
}
...
...
src/Operation/ChangeStream.php
View file @
b8e07dba
...
@@ -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
()
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment