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
03e8038a
Unverified
Commit
03e8038a
authored
Aug 28, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #673
parents
27892777
4a764fee
Hide whitespace changes
Inline
Side-by-side
Showing
86 changed files
with
598 additions
and
18 deletions
+598
-18
phpcs.xml.dist
phpcs.xml.dist
+18
-3
BulkWriteResult.php
src/BulkWriteResult.php
+5
-0
ChangeStream.php
src/ChangeStream.php
+8
-0
Client.php
src/Client.php
+16
-0
Collection.php
src/Collection.php
+22
-0
Database.php
src/Database.php
+18
-0
DeleteResult.php
src/DeleteResult.php
+3
-3
Bucket.php
src/GridFS/Bucket.php
+26
-0
CollectionWrapper.php
src/GridFS/CollectionWrapper.php
+9
-0
ReadableStream.php
src/GridFS/ReadableStream.php
+19
-0
StreamWrapper.php
src/GridFS/StreamWrapper.php
+6
-3
WritableStream.php
src/GridFS/WritableStream.php
+18
-0
InsertManyResult.php
src/InsertManyResult.php
+5
-0
InsertOneResult.php
src/InsertOneResult.php
+5
-0
MapReduceResult.php
src/MapReduceResult.php
+7
-0
BSONIterator.php
src/Model/BSONIterator.php
+12
-0
CachingIterator.php
src/Model/CachingIterator.php
+7
-0
ChangeStreamIterator.php
src/Model/ChangeStreamIterator.php
+9
-0
CollectionInfo.php
src/Model/CollectionInfo.php
+1
-0
DatabaseInfo.php
src/Model/DatabaseInfo.php
+1
-0
DatabaseInfoLegacyIterator.php
src/Model/DatabaseInfoLegacyIterator.php
+1
-0
IndexInfo.php
src/Model/IndexInfo.php
+1
-0
IndexInput.php
src/Model/IndexInput.php
+1
-0
Aggregate.php
src/Operation/Aggregate.php
+14
-0
BulkWrite.php
src/Operation/BulkWrite.php
+16
-0
Count.php
src/Operation/Count.php
+10
-0
CountDocuments.php
src/Operation/CountDocuments.php
+11
-0
CreateCollection.php
src/Operation/CreateCollection.php
+8
-0
CreateIndexes.php
src/Operation/CreateIndexes.php
+12
-0
DatabaseCommand.php
src/Operation/DatabaseCommand.php
+5
-0
Delete.php
src/Operation/Delete.php
+10
-0
DeleteMany.php
src/Operation/DeleteMany.php
+1
-0
DeleteOne.php
src/Operation/DeleteOne.php
+1
-0
Distinct.php
src/Operation/Distinct.php
+12
-0
DropCollection.php
src/Operation/DropCollection.php
+8
-0
DropDatabase.php
src/Operation/DropDatabase.php
+4
-0
DropIndexes.php
src/Operation/DropIndexes.php
+8
-0
EstimatedDocumentCount.php
src/Operation/EstimatedDocumentCount.php
+7
-0
Explain.php
src/Operation/Explain.php
+8
-0
Find.php
src/Operation/Find.php
+10
-0
FindAndModify.php
src/Operation/FindAndModify.php
+12
-0
FindOne.php
src/Operation/FindOne.php
+1
-0
FindOneAndDelete.php
src/Operation/FindOneAndDelete.php
+1
-0
FindOneAndReplace.php
src/Operation/FindOneAndReplace.php
+1
-0
FindOneAndUpdate.php
src/Operation/FindOneAndUpdate.php
+1
-0
InsertMany.php
src/Operation/InsertMany.php
+8
-0
InsertOne.php
src/Operation/InsertOne.php
+8
-0
ListCollections.php
src/Operation/ListCollections.php
+3
-0
ListDatabases.php
src/Operation/ListDatabases.php
+1
-0
ListIndexes.php
src/Operation/ListIndexes.php
+8
-0
MapReduce.php
src/Operation/MapReduce.php
+18
-0
ModifyCollection.php
src/Operation/ModifyCollection.php
+7
-0
ReplaceOne.php
src/Operation/ReplaceOne.php
+1
-0
Update.php
src/Operation/Update.php
+14
-0
UpdateMany.php
src/Operation/UpdateMany.php
+1
-0
UpdateOne.php
src/Operation/UpdateOne.php
+1
-0
Watch.php
src/Operation/Watch.php
+24
-2
UpdateResult.php
src/UpdateResult.php
+3
-3
ClientFunctionalTest.php
tests/ClientFunctionalTest.php
+1
-0
CrudSpecFunctionalTest.php
tests/Collection/CrudSpecFunctionalTest.php
+1
-0
FunctionalTestCase.php
tests/Collection/FunctionalTestCase.php
+1
-0
CommandObserver.php
tests/CommandObserver.php
+1
-0
FunctionalTestCase.php
tests/Database/FunctionalTestCase.php
+1
-0
FunctionalTestCase.php
tests/FunctionalTestCase.php
+2
-0
FunctionalTestCase.php
tests/GridFS/FunctionalTestCase.php
+5
-0
ReadableStreamFunctionalTest.php
tests/GridFS/ReadableStreamFunctionalTest.php
+1
-0
SpecFunctionalTest.php
tests/GridFS/SpecFunctionalTest.php
+3
-0
WritableStreamFunctionalTest.php
tests/GridFS/WritableStreamFunctionalTest.php
+1
-0
ChangeStreamIteratorTest.php
tests/Model/ChangeStreamIteratorTest.php
+1
-0
IndexInfoFunctionalTest.php
tests/Model/IndexInfoFunctionalTest.php
+1
-0
BulkWriteFunctionalTest.php
tests/Operation/BulkWriteFunctionalTest.php
+1
-0
DeleteFunctionalTest.php
tests/Operation/DeleteFunctionalTest.php
+1
-0
InsertManyFunctionalTest.php
tests/Operation/InsertManyFunctionalTest.php
+1
-0
InsertOneFunctionalTest.php
tests/Operation/InsertOneFunctionalTest.php
+1
-0
UpdateFunctionalTest.php
tests/Operation/UpdateFunctionalTest.php
+1
-0
WatchFunctionalTest.php
tests/Operation/WatchFunctionalTest.php
+2
-0
ChangeStreamsSpecTest.php
tests/SpecTests/ChangeStreamsSpecTest.php
+1
-0
CommandExpectations.php
tests/SpecTests/CommandExpectations.php
+11
-0
Context.php
tests/SpecTests/Context.php
+26
-0
DocumentsMatchConstraint.php
tests/SpecTests/DocumentsMatchConstraint.php
+14
-2
ErrorExpectation.php
tests/SpecTests/ErrorExpectation.php
+13
-0
FunctionalTestCase.php
tests/SpecTests/FunctionalTestCase.php
+1
-0
Operation.php
tests/SpecTests/Operation.php
+14
-0
ResultExpectation.php
tests/SpecTests/ResultExpectation.php
+9
-0
RetryableReadsSpecTest.php
tests/SpecTests/RetryableReadsSpecTest.php
+1
-0
TransactionsSpecTest.php
tests/SpecTests/TransactionsSpecTest.php
+6
-2
No files found.
phpcs.xml.dist
View file @
03e8038a
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
<!-- Exclude sniffs that require newer PHP versions -->
<!-- Exclude sniffs that require newer PHP versions -->
<!-- Available with PHP 7.0 -->
<!-- Available with PHP 7.0 -->
<exclude
name=
"SlevomatCodingStandard.TypeHints.DeclareStrictTypes"
/>
<exclude
name=
"SlevomatCodingStandard.TypeHints.DeclareStrictTypes"
/>
<!-- In addition to requiring PHP 7.0, this sniff will cause a significant amount of BC breaks. Proceed with caution! -->
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration"
/>
<exclude
name=
"SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"
/>
<exclude
name=
"SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly"
/>
<exclude
name=
"SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"
/>
<exclude
name=
"SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator"
/>
...
@@ -61,7 +59,6 @@
...
@@ -61,7 +59,6 @@
<!-- These sniffs cause a large diff, so enable them in separate steps -->
<!-- These sniffs cause a large diff, so enable them in separate steps -->
<exclude
name=
"SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup"
/>
<exclude
name=
"SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup"
/>
<exclude
name=
"SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment"
/>
<exclude
name=
"Squiz.Strings.DoubleQuoteUsage"
/>
<exclude
name=
"Squiz.Strings.DoubleQuoteUsage"
/>
<!-- Sniff currently breaks, see https://github.com/slevomat/coding-standard/issues/727 -->
<!-- Sniff currently breaks, see https://github.com/slevomat/coding-standard/issues/727 -->
...
@@ -90,6 +87,24 @@
...
@@ -90,6 +87,24 @@
</properties>
</properties>
</rule>
</rule>
<!-- Only enable some checks regarding type hints -->
<!-- In addition to requiring PHP 7.0, this sniff will cause a significant amount of BC breaks. Proceed with caution! -->
<rule
ref=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration"
>
<!-- Traversable type hints often end up as mixed[], so we skip them for now -->
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification"
/>
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification"
/>
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification"
/>
<!-- Will cause BC breaks to method signatures - disabled for now -->
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint"
/>
<exclude
name=
"SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"
/>
<properties>
<property
name=
"enableObjectTypeHint"
value=
"true"
/>
<property
name=
"enableEachParameterAndReturnInspection"
value=
"false"
/>
</properties>
</rule>
<rule
ref=
"PSR1.Methods.CamelCapsMethodName.NotCamelCaps"
>
<rule
ref=
"PSR1.Methods.CamelCapsMethodName.NotCamelCaps"
>
<exclude-pattern>
/src/GridFS/StreamWrapper
</exclude-pattern>
<exclude-pattern>
/src/GridFS/StreamWrapper
</exclude-pattern>
<exclude-pattern>
/tests/DocumentationExamplesTest.php
</exclude-pattern>
<exclude-pattern>
/tests/DocumentationExamplesTest.php
</exclude-pattern>
...
...
src/BulkWriteResult.php
View file @
03e8038a
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
*/
*/
class
BulkWriteResult
class
BulkWriteResult
{
{
/** @var WriteResult */
private
$writeResult
;
private
$writeResult
;
/** @var mixed[] */
private
$insertedIds
;
private
$insertedIds
;
/** @var boolean */
private
$isAcknowledged
;
private
$isAcknowledged
;
/**
/**
...
...
src/ChangeStream.php
View file @
03e8038a
...
@@ -42,19 +42,27 @@ class ChangeStream implements Iterator
...
@@ -42,19 +42,27 @@ class ChangeStream implements Iterator
*/
*/
const
CURSOR_NOT_FOUND
=
43
;
const
CURSOR_NOT_FOUND
=
43
;
/** @var array */
private
static
$nonResumableErrorCodes
=
[
private
static
$nonResumableErrorCodes
=
[
136
,
// CappedPositionLost
136
,
// CappedPositionLost
237
,
// CursorKilled
237
,
// CursorKilled
11601
,
// Interrupted
11601
,
// Interrupted
];
];
/** @var callable */
private
$resumeCallable
;
private
$resumeCallable
;
/** @var ChangeStreamIterator */
private
$iterator
;
private
$iterator
;
/** @var integer */
private
$key
=
0
;
private
$key
=
0
;
/**
/**
* Whether the change stream has advanced to its first result. This is used
* Whether the change stream has advanced to its first result. This is used
* to determine whether $key should be incremented after an iteration event.
* to determine whether $key should be incremented after an iteration event.
*
* @var boolean
*/
*/
private
$hasAdvanced
=
false
;
private
$hasAdvanced
=
false
;
...
...
src/Client.php
View file @
03e8038a
...
@@ -37,19 +37,35 @@ use function is_array;
...
@@ -37,19 +37,35 @@ use function is_array;
class
Client
class
Client
{
{
/** @var array */
private
static
$defaultTypeMap
=
[
private
static
$defaultTypeMap
=
[
'array'
=>
BSONArray
::
class
,
'array'
=>
BSONArray
::
class
,
'document'
=>
BSONDocument
::
class
,
'document'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
];
];
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var integer */
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
/** @var Manager */
private
$manager
;
private
$manager
;
/** @var ReadConcern */
private
$readConcern
;
private
$readConcern
;
/** @var ReadPreference */
private
$readPreference
;
private
$readPreference
;
/** @var string */
private
$uri
;
private
$uri
;
/** @var array */
private
$typeMap
;
private
$typeMap
;
/** @var WriteConcern */
private
$writeConcern
;
private
$writeConcern
;
/**
/**
...
...
src/Collection.php
View file @
03e8038a
...
@@ -66,22 +66,44 @@ use function strlen;
...
@@ -66,22 +66,44 @@ use function strlen;
class
Collection
class
Collection
{
{
/** @var array */
private
static
$defaultTypeMap
=
[
private
static
$defaultTypeMap
=
[
'array'
=>
BSONArray
::
class
,
'array'
=>
BSONArray
::
class
,
'document'
=>
BSONDocument
::
class
,
'document'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
];
];
/** @var integer */
private
static
$wireVersionForFindAndModifyWriteConcern
=
4
;
private
static
$wireVersionForFindAndModifyWriteConcern
=
4
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var integer */
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
/** @var integer */
private
static
$wireVersionForReadConcernWithWriteStage
=
8
;
private
static
$wireVersionForReadConcernWithWriteStage
=
8
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var Manager */
private
$manager
;
private
$manager
;
/** @var ReadConcern */
private
$readConcern
;
private
$readConcern
;
/** @var ReadPreference */
private
$readPreference
;
private
$readPreference
;
/** @var array */
private
$typeMap
;
private
$typeMap
;
/** @var WriteConcern */
private
$writeConcern
;
private
$writeConcern
;
/**
/**
...
...
src/Database.php
View file @
03e8038a
...
@@ -44,20 +44,38 @@ use function strlen;
...
@@ -44,20 +44,38 @@ use function strlen;
class
Database
class
Database
{
{
/** @var array */
private
static
$defaultTypeMap
=
[
private
static
$defaultTypeMap
=
[
'array'
=>
BSONArray
::
class
,
'array'
=>
BSONArray
::
class
,
'document'
=>
BSONDocument
::
class
,
'document'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
];
];
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var integer */
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
private
static
$wireVersionForWritableCommandWriteConcern
=
5
;
/** @var integer */
private
static
$wireVersionForReadConcernWithWriteStage
=
8
;
private
static
$wireVersionForReadConcernWithWriteStage
=
8
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var Manager */
private
$manager
;
private
$manager
;
/** @var ReadConcern */
private
$readConcern
;
private
$readConcern
;
/** @var ReadPreference */
private
$readPreference
;
private
$readPreference
;
/** @var array */
private
$typeMap
;
private
$typeMap
;
/** @var WriteConcern */
private
$writeConcern
;
private
$writeConcern
;
/**
/**
...
...
src/DeleteResult.php
View file @
03e8038a
...
@@ -25,12 +25,12 @@ use MongoDB\Exception\BadMethodCallException;
...
@@ -25,12 +25,12 @@ use MongoDB\Exception\BadMethodCallException;
*/
*/
class
DeleteResult
class
DeleteResult
{
{
/** @var WriteResult */
private
$writeResult
;
private
$writeResult
;
/** @var boolean */
private
$isAcknowledged
;
private
$isAcknowledged
;
/**
* @param WriteResult $writeResult
*/
public
function
__construct
(
WriteResult
$writeResult
)
public
function
__construct
(
WriteResult
$writeResult
)
{
{
$this
->
writeResult
=
$writeResult
;
$this
->
writeResult
=
$writeResult
;
...
...
src/GridFS/Bucket.php
View file @
03e8038a
...
@@ -62,24 +62,50 @@ use function urlencode;
...
@@ -62,24 +62,50 @@ use function urlencode;
*/
*/
class
Bucket
class
Bucket
{
{
/** @var string */
private
static
$defaultBucketName
=
'fs'
;
private
static
$defaultBucketName
=
'fs'
;
/** @var integer */
private
static
$defaultChunkSizeBytes
=
261120
;
private
static
$defaultChunkSizeBytes
=
261120
;
/** @var array */
private
static
$defaultTypeMap
=
[
private
static
$defaultTypeMap
=
[
'array'
=>
BSONArray
::
class
,
'array'
=>
BSONArray
::
class
,
'document'
=>
BSONDocument
::
class
,
'document'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
'root'
=>
BSONDocument
::
class
,
];
];
/** @var string */
private
static
$streamWrapperProtocol
=
'gridfs'
;
private
static
$streamWrapperProtocol
=
'gridfs'
;
/** @var CollectionWrapper */
private
$collectionWrapper
;
private
$collectionWrapper
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var Manager */
private
$manager
;
private
$manager
;
/** @var string */
private
$bucketName
;
private
$bucketName
;
/** @var boolean */
private
$disableMD5
;
private
$disableMD5
;
/** @var integer */
private
$chunkSizeBytes
;
private
$chunkSizeBytes
;
/** @var ReadConcern */
private
$readConcern
;
private
$readConcern
;
/** @var ReadPreference */
private
$readPreference
;
private
$readPreference
;
/** @var array */
private
$typeMap
;
private
$typeMap
;
/** @var WriteConcern */
private
$writeConcern
;
private
$writeConcern
;
/**
/**
...
...
src/GridFS/CollectionWrapper.php
View file @
03e8038a
...
@@ -34,10 +34,19 @@ use function sprintf;
...
@@ -34,10 +34,19 @@ use function sprintf;
*/
*/
class
CollectionWrapper
class
CollectionWrapper
{
{
/** @var string */
private
$bucketName
;
private
$bucketName
;
/** @var Collection */
private
$chunksCollection
;
private
$chunksCollection
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var boolean */
private
$checkedIndexes
=
false
;
private
$checkedIndexes
=
false
;
/** @var Collection */
private
$filesCollection
;
private
$filesCollection
;
/**
/**
...
...
src/GridFS/ReadableStream.php
View file @
03e8038a
...
@@ -36,15 +36,34 @@ use function substr;
...
@@ -36,15 +36,34 @@ use function substr;
*/
*/
class
ReadableStream
class
ReadableStream
{
{
/** @var string|null */
private
$buffer
;
private
$buffer
;
/** @var integer */
private
$bufferOffset
=
0
;
private
$bufferOffset
=
0
;
/** @var integer */
private
$chunkSize
;
private
$chunkSize
;
/** @var integer */
private
$chunkOffset
=
0
;
private
$chunkOffset
=
0
;
/** @var IteratorIterator|null */
private
$chunksIterator
;
private
$chunksIterator
;
/** @var CollectionWrapper */
private
$collectionWrapper
;
private
$collectionWrapper
;
/** @var float|integer */
private
$expectedLastChunkSize
=
0
;
private
$expectedLastChunkSize
=
0
;
/** @var stdClass */
private
$file
;
private
$file
;
/** @var integer */
private
$length
;
private
$length
;
/** @var integer */
private
$numChunks
=
0
;
private
$numChunks
=
0
;
/**
/**
...
...
src/GridFS/StreamWrapper.php
View file @
03e8038a
...
@@ -45,13 +45,16 @@ use const STREAM_IS_URL;
...
@@ -45,13 +45,16 @@ use const STREAM_IS_URL;
*/
*/
class
StreamWrapper
class
StreamWrapper
{
{
/**
/** @var resource|null Stream context (set by PHP) */
* @var resource|null Stream context (set by PHP)
*/
public
$context
;
public
$context
;
/** @var string|null */
private
$mode
;
private
$mode
;
/** @var string|null */
private
$protocol
;
private
$protocol
;
/** @var ReadableStream|WritableStream|null */
private
$stream
;
private
$stream
;
/**
/**
...
...
src/GridFS/WritableStream.php
View file @
03e8038a
...
@@ -44,16 +44,34 @@ use function substr;
...
@@ -44,16 +44,34 @@ use function substr;
*/
*/
class
WritableStream
class
WritableStream
{
{
/** @var integer */
private
static
$defaultChunkSizeBytes
=
261120
;
private
static
$defaultChunkSizeBytes
=
261120
;
/** @var string */
private
$buffer
=
''
;
private
$buffer
=
''
;
/** @var integer */
private
$chunkOffset
=
0
;
private
$chunkOffset
=
0
;
/** @var integer */
private
$chunkSize
;
private
$chunkSize
;
/** @var boolean */
private
$disableMD5
;
private
$disableMD5
;
/** @var CollectionWrapper */
private
$collectionWrapper
;
private
$collectionWrapper
;
/** @var array */
private
$file
;
private
$file
;
/** @var resource */
private
$hashCtx
;
private
$hashCtx
;
/** @var boolean */
private
$isClosed
=
false
;
private
$isClosed
=
false
;
/** @var integer */
private
$length
=
0
;
private
$length
=
0
;
/**
/**
...
...
src/InsertManyResult.php
View file @
03e8038a
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
*/
*/
class
InsertManyResult
class
InsertManyResult
{
{
/** @var WriteResult */
private
$writeResult
;
private
$writeResult
;
/** @var mixed[] */
private
$insertedIds
;
private
$insertedIds
;
/** @var boolean */
private
$isAcknowledged
;
private
$isAcknowledged
;
/**
/**
...
...
src/InsertOneResult.php
View file @
03e8038a
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
...
@@ -25,8 +25,13 @@ use MongoDB\Exception\BadMethodCallException;
*/
*/
class
InsertOneResult
class
InsertOneResult
{
{
/** @var WriteResult */
private
$writeResult
;
private
$writeResult
;
/** @var mixed */
private
$insertedId
;
private
$insertedId
;
/** @var boolean */
private
$isAcknowledged
;
private
$isAcknowledged
;
/**
/**
...
...
src/MapReduceResult.php
View file @
03e8038a
...
@@ -35,9 +35,16 @@ use function call_user_func;
...
@@ -35,9 +35,16 @@ use function call_user_func;
*/
*/
class
MapReduceResult
implements
IteratorAggregate
class
MapReduceResult
implements
IteratorAggregate
{
{
/** @var callable */
private
$getIterator
;
private
$getIterator
;
/** @var integer */
private
$executionTimeMS
;
private
$executionTimeMS
;
/** @var array */
private
$counts
;
private
$counts
;
/** @var array */
private
$timing
;
private
$timing
;
/**
/**
...
...
src/Model/BSONIterator.php
View file @
03e8038a
...
@@ -32,13 +32,25 @@ use function unpack;
...
@@ -32,13 +32,25 @@ use function unpack;
*/
*/
class
BSONIterator
implements
Iterator
class
BSONIterator
implements
Iterator
{
{
/** @var integer */
private
static
$bsonSize
=
4
;
private
static
$bsonSize
=
4
;
/** @var string */
private
$buffer
;
private
$buffer
;
/** @var integer */
private
$bufferLength
;
private
$bufferLength
;
/** @var mixed */
private
$current
;
private
$current
;
/** @var integer */
private
$key
=
0
;
private
$key
=
0
;
/** @var integer */
private
$position
=
0
;
private
$position
=
0
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Model/CachingIterator.php
View file @
03e8038a
...
@@ -38,9 +38,16 @@ use function reset;
...
@@ -38,9 +38,16 @@ use function reset;
*/
*/
class
CachingIterator
implements
Countable
,
Iterator
class
CachingIterator
implements
Countable
,
Iterator
{
{
/** @var array */
private
$items
=
[];
private
$items
=
[];
/** @var Generator */
private
$iterator
;
private
$iterator
;
/** @var boolean */
private
$iteratorAdvanced
=
false
;
private
$iteratorAdvanced
=
false
;
/** @var boolean */
private
$iteratorExhausted
=
false
;
private
$iteratorExhausted
=
false
;
/**
/**
...
...
src/Model/ChangeStreamIterator.php
View file @
03e8038a
...
@@ -45,10 +45,19 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
...
@@ -45,10 +45,19 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
*/
*/
class
ChangeStreamIterator
extends
IteratorIterator
implements
CommandSubscriber
class
ChangeStreamIterator
extends
IteratorIterator
implements
CommandSubscriber
{
{
/** @var integer */
private
$batchPosition
=
0
;
private
$batchPosition
=
0
;
/** @var integer */
private
$batchSize
;
private
$batchSize
;
/** @var boolean */
private
$isRewindNop
;
private
$isRewindNop
;
/** @var object|null */
private
$postBatchResumeToken
;
private
$postBatchResumeToken
;
/** @var array|object|null */
private
$resumeToken
;
private
$resumeToken
;
/**
/**
...
...
src/Model/CollectionInfo.php
View file @
03e8038a
...
@@ -34,6 +34,7 @@ use function array_key_exists;
...
@@ -34,6 +34,7 @@ use function array_key_exists;
*/
*/
class
CollectionInfo
implements
ArrayAccess
class
CollectionInfo
implements
ArrayAccess
{
{
/** @var array */
private
$info
;
private
$info
;
/**
/**
...
...
src/Model/DatabaseInfo.php
View file @
03e8038a
...
@@ -33,6 +33,7 @@ use function array_key_exists;
...
@@ -33,6 +33,7 @@ use function array_key_exists;
*/
*/
class
DatabaseInfo
implements
ArrayAccess
class
DatabaseInfo
implements
ArrayAccess
{
{
/** @var array */
private
$info
;
private
$info
;
/**
/**
...
...
src/Model/DatabaseInfoLegacyIterator.php
View file @
03e8038a
...
@@ -34,6 +34,7 @@ use function reset;
...
@@ -34,6 +34,7 @@ use function reset;
*/
*/
class
DatabaseInfoLegacyIterator
implements
DatabaseInfoIterator
class
DatabaseInfoLegacyIterator
implements
DatabaseInfoIterator
{
{
/** @var array */
private
$databases
;
private
$databases
;
/**
/**
...
...
src/Model/IndexInfo.php
View file @
03e8038a
...
@@ -39,6 +39,7 @@ use function array_search;
...
@@ -39,6 +39,7 @@ use function array_search;
*/
*/
class
IndexInfo
implements
ArrayAccess
class
IndexInfo
implements
ArrayAccess
{
{
/** @var array */
private
$info
;
private
$info
;
/**
/**
...
...
src/Model/IndexInput.php
View file @
03e8038a
...
@@ -39,6 +39,7 @@ use function sprintf;
...
@@ -39,6 +39,7 @@ use function sprintf;
*/
*/
class
IndexInput
implements
Serializable
class
IndexInput
implements
Serializable
{
{
/** @var array */
private
$index
;
private
$index
;
/**
/**
...
...
src/Operation/Aggregate.php
View file @
03e8038a
...
@@ -50,14 +50,28 @@ use function sprintf;
...
@@ -50,14 +50,28 @@ use function sprintf;
*/
*/
class
Aggregate
implements
Executable
class
Aggregate
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string|null */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$pipeline
;
private
$pipeline
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/BulkWrite.php
View file @
03e8038a
...
@@ -51,15 +51,31 @@ class BulkWrite implements Executable
...
@@ -51,15 +51,31 @@ class BulkWrite implements Executable
const
UPDATE_MANY
=
'updateMany'
;
const
UPDATE_MANY
=
'updateMany'
;
const
UPDATE_ONE
=
'updateOne'
;
const
UPDATE_ONE
=
'updateOne'
;
/** @var integer */
private
static
$wireVersionForArrayFilters
=
6
;
private
static
$wireVersionForArrayFilters
=
6
;
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array[] */
private
$operations
;
private
$operations
;
/** @var array */
private
$options
;
private
$options
;
/** @var boolean */
private
$isArrayFiltersUsed
=
false
;
private
$isArrayFiltersUsed
=
false
;
/** @var boolean */
private
$isCollationUsed
=
false
;
private
$isCollationUsed
=
false
;
/**
/**
...
...
src/Operation/Count.php
View file @
03e8038a
...
@@ -43,12 +43,22 @@ use function MongoDB\server_supports_feature;
...
@@ -43,12 +43,22 @@ use function MongoDB\server_supports_feature;
*/
*/
class
Count
implements
Executable
,
Explainable
class
Count
implements
Executable
,
Explainable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/CountDocuments.php
View file @
03e8038a
...
@@ -39,11 +39,22 @@ use function is_object;
...
@@ -39,11 +39,22 @@ use function is_object;
*/
*/
class
CountDocuments
implements
Executable
class
CountDocuments
implements
Executable
{
{
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var array */
private
$aggregateOptions
;
private
$aggregateOptions
;
/** @var array */
private
$countOptions
;
private
$countOptions
;
/** @var Aggregate */
private
$aggregate
;
private
$aggregate
;
/**
/**
...
...
src/Operation/CreateCollection.php
View file @
03e8038a
...
@@ -46,11 +46,19 @@ class CreateCollection implements Executable
...
@@ -46,11 +46,19 @@ class CreateCollection implements Executable
const
USE_POWER_OF_2_SIZES
=
1
;
const
USE_POWER_OF_2_SIZES
=
1
;
const
NO_PADDING
=
2
;
const
NO_PADDING
=
2
;
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$options
=
[];
private
$options
=
[];
/**
/**
...
...
src/Operation/CreateIndexes.php
View file @
03e8038a
...
@@ -41,13 +41,25 @@ use function sprintf;
...
@@ -41,13 +41,25 @@ use function sprintf;
*/
*/
class
CreateIndexes
implements
Executable
class
CreateIndexes
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$indexes
=
[];
private
$indexes
=
[];
/** @var boolean */
private
$isCollationUsed
=
false
;
private
$isCollationUsed
=
false
;
/** @var array */
private
$options
=
[];
private
$options
=
[];
/**
/**
...
...
src/Operation/DatabaseCommand.php
View file @
03e8038a
...
@@ -34,8 +34,13 @@ use function is_object;
...
@@ -34,8 +34,13 @@ use function is_object;
*/
*/
class
DatabaseCommand
implements
Executable
class
DatabaseCommand
implements
Executable
{
{
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var array|Command|object */
private
$command
;
private
$command
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/Delete.php
View file @
03e8038a
...
@@ -40,12 +40,22 @@ use function MongoDB\server_supports_feature;
...
@@ -40,12 +40,22 @@ use function MongoDB\server_supports_feature;
*/
*/
class
Delete
implements
Executable
,
Explainable
class
Delete
implements
Executable
,
Explainable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var integer */
private
$limit
;
private
$limit
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/DeleteMany.php
View file @
03e8038a
...
@@ -32,6 +32,7 @@ use MongoDB\Exception\UnsupportedException;
...
@@ -32,6 +32,7 @@ use MongoDB\Exception\UnsupportedException;
*/
*/
class
DeleteMany
implements
Executable
,
Explainable
class
DeleteMany
implements
Executable
,
Explainable
{
{
/** @var Delete */
private
$delete
;
private
$delete
;
/**
/**
...
...
src/Operation/DeleteOne.php
View file @
03e8038a
...
@@ -32,6 +32,7 @@ use MongoDB\Exception\UnsupportedException;
...
@@ -32,6 +32,7 @@ use MongoDB\Exception\UnsupportedException;
*/
*/
class
DeleteOne
implements
Executable
,
Explainable
class
DeleteOne
implements
Executable
,
Explainable
{
{
/** @var Delete */
private
$delete
;
private
$delete
;
/**
/**
...
...
src/Operation/Distinct.php
View file @
03e8038a
...
@@ -42,13 +42,25 @@ use function MongoDB\server_supports_feature;
...
@@ -42,13 +42,25 @@ use function MongoDB\server_supports_feature;
*/
*/
class
Distinct
implements
Executable
,
Explainable
class
Distinct
implements
Executable
,
Explainable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var string */
private
$fieldName
;
private
$fieldName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/DropCollection.php
View file @
03e8038a
...
@@ -38,11 +38,19 @@ use function MongoDB\server_supports_feature;
...
@@ -38,11 +38,19 @@ use function MongoDB\server_supports_feature;
*/
*/
class
DropCollection
implements
Executable
class
DropCollection
implements
Executable
{
{
/** @var string */
private
static
$errorMessageNamespaceNotFound
=
'ns not found'
;
private
static
$errorMessageNamespaceNotFound
=
'ns not found'
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/DropDatabase.php
View file @
03e8038a
...
@@ -38,9 +38,13 @@ use function MongoDB\server_supports_feature;
...
@@ -38,9 +38,13 @@ use function MongoDB\server_supports_feature;
*/
*/
class
DropDatabase
implements
Executable
class
DropDatabase
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/DropIndexes.php
View file @
03e8038a
...
@@ -38,11 +38,19 @@ use function MongoDB\server_supports_feature;
...
@@ -38,11 +38,19 @@ use function MongoDB\server_supports_feature;
*/
*/
class
DropIndexes
implements
Executable
class
DropIndexes
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForWriteConcern
=
5
;
private
static
$wireVersionForWriteConcern
=
5
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var string */
private
$indexName
;
private
$indexName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/EstimatedDocumentCount.php
View file @
03e8038a
...
@@ -33,9 +33,16 @@ use function array_intersect_key;
...
@@ -33,9 +33,16 @@ use function array_intersect_key;
*/
*/
class
EstimatedDocumentCount
implements
Executable
,
Explainable
class
EstimatedDocumentCount
implements
Executable
,
Explainable
{
{
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$options
;
private
$options
;
/** @var Count */
private
$count
;
private
$count
;
/**
/**
...
...
src/Operation/Explain.php
View file @
03e8038a
...
@@ -41,11 +41,19 @@ class Explain implements Executable
...
@@ -41,11 +41,19 @@ class Explain implements Executable
const
VERBOSITY_EXEC_STATS
=
'executionStats'
;
const
VERBOSITY_EXEC_STATS
=
'executionStats'
;
const
VERBOSITY_QUERY
=
'queryPlanner'
;
const
VERBOSITY_QUERY
=
'queryPlanner'
;
/** @var integer */
private
static
$wireVersionForDistinct
=
4
;
private
static
$wireVersionForDistinct
=
4
;
/** @var integer */
private
static
$wireVersionForFindAndModify
=
4
;
private
static
$wireVersionForFindAndModify
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var Explainable */
private
$explainable
;
private
$explainable
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/Find.php
View file @
03e8038a
...
@@ -49,12 +49,22 @@ class Find implements Executable, Explainable
...
@@ -49,12 +49,22 @@ class Find implements Executable, Explainable
const
TAILABLE
=
2
;
const
TAILABLE
=
2
;
const
TAILABLE_AWAIT
=
3
;
const
TAILABLE_AWAIT
=
3
;
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/FindAndModify.php
View file @
03e8038a
...
@@ -45,13 +45,25 @@ use function MongoDB\server_supports_feature;
...
@@ -45,13 +45,25 @@ use function MongoDB\server_supports_feature;
*/
*/
class
FindAndModify
implements
Executable
,
Explainable
class
FindAndModify
implements
Executable
,
Explainable
{
{
/** @var integer */
private
static
$wireVersionForArrayFilters
=
6
;
private
static
$wireVersionForArrayFilters
=
6
;
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
4
;
private
static
$wireVersionForWriteConcern
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/FindOne.php
View file @
03e8038a
...
@@ -33,6 +33,7 @@ use function current;
...
@@ -33,6 +33,7 @@ use function current;
*/
*/
class
FindOne
implements
Executable
,
Explainable
class
FindOne
implements
Executable
,
Explainable
{
{
/** @var Find */
private
$find
;
private
$find
;
/**
/**
...
...
src/Operation/FindOneAndDelete.php
View file @
03e8038a
...
@@ -33,6 +33,7 @@ use function is_object;
...
@@ -33,6 +33,7 @@ use function is_object;
*/
*/
class
FindOneAndDelete
implements
Executable
,
Explainable
class
FindOneAndDelete
implements
Executable
,
Explainable
{
{
/** @var FindAndModify */
private
$findAndModify
;
private
$findAndModify
;
/**
/**
...
...
src/Operation/FindOneAndReplace.php
View file @
03e8038a
...
@@ -38,6 +38,7 @@ class FindOneAndReplace implements Executable, Explainable
...
@@ -38,6 +38,7 @@ class FindOneAndReplace implements Executable, Explainable
const
RETURN_DOCUMENT_BEFORE
=
1
;
const
RETURN_DOCUMENT_BEFORE
=
1
;
const
RETURN_DOCUMENT_AFTER
=
2
;
const
RETURN_DOCUMENT_AFTER
=
2
;
/** @var FindAndModify */
private
$findAndModify
;
private
$findAndModify
;
/**
/**
...
...
src/Operation/FindOneAndUpdate.php
View file @
03e8038a
...
@@ -39,6 +39,7 @@ class FindOneAndUpdate implements Executable, Explainable
...
@@ -39,6 +39,7 @@ class FindOneAndUpdate implements Executable, Explainable
const
RETURN_DOCUMENT_BEFORE
=
1
;
const
RETURN_DOCUMENT_BEFORE
=
1
;
const
RETURN_DOCUMENT_AFTER
=
2
;
const
RETURN_DOCUMENT_AFTER
=
2
;
/** @var FindAndModify */
private
$findAndModify
;
private
$findAndModify
;
/**
/**
...
...
src/Operation/InsertMany.php
View file @
03e8038a
...
@@ -40,11 +40,19 @@ use function sprintf;
...
@@ -40,11 +40,19 @@ use function sprintf;
*/
*/
class
InsertMany
implements
Executable
class
InsertMany
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var object[]|array[] */
private
$documents
;
private
$documents
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/InsertOne.php
View file @
03e8038a
...
@@ -39,11 +39,19 @@ use function MongoDB\server_supports_feature;
...
@@ -39,11 +39,19 @@ use function MongoDB\server_supports_feature;
*/
*/
class
InsertOne
implements
Executable
class
InsertOne
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$document
;
private
$document
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/ListCollections.php
View file @
03e8038a
...
@@ -38,7 +38,10 @@ use function is_object;
...
@@ -38,7 +38,10 @@ use function is_object;
*/
*/
class
ListCollections
implements
Executable
class
ListCollections
implements
Executable
{
{
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/ListDatabases.php
View file @
03e8038a
...
@@ -39,6 +39,7 @@ use function is_object;
...
@@ -39,6 +39,7 @@ use function is_object;
*/
*/
class
ListDatabases
implements
Executable
class
ListDatabases
implements
Executable
{
{
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/ListIndexes.php
View file @
03e8038a
...
@@ -37,11 +37,19 @@ use function is_integer;
...
@@ -37,11 +37,19 @@ use function is_integer;
*/
*/
class
ListIndexes
implements
Executable
class
ListIndexes
implements
Executable
{
{
/** @var integer */
private
static
$errorCodeDatabaseNotFound
=
60
;
private
static
$errorCodeDatabaseNotFound
=
60
;
/** @var integer */
private
static
$errorCodeNamespaceNotFound
=
26
;
private
static
$errorCodeNamespaceNotFound
=
26
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/MapReduce.php
View file @
03e8038a
...
@@ -50,16 +50,34 @@ use function MongoDB\server_supports_feature;
...
@@ -50,16 +50,34 @@ use function MongoDB\server_supports_feature;
*/
*/
class
MapReduce
implements
Executable
class
MapReduce
implements
Executable
{
{
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var integer */
private
static
$wireVersionForReadConcern
=
4
;
private
static
$wireVersionForReadConcern
=
4
;
/** @var integer */
private
static
$wireVersionForWriteConcern
=
4
;
private
static
$wireVersionForWriteConcern
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var JavascriptInterface */
private
$map
;
private
$map
;
/** @var JavascriptInterface */
private
$reduce
;
private
$reduce
;
/** @var array|object|string */
private
$out
;
private
$out
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/ModifyCollection.php
View file @
03e8038a
...
@@ -37,9 +37,16 @@ use function MongoDB\server_supports_feature;
...
@@ -37,9 +37,16 @@ use function MongoDB\server_supports_feature;
*/
*/
class
ModifyCollection
implements
Executable
class
ModifyCollection
implements
Executable
{
{
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$collectionOptions
;
private
$collectionOptions
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/ReplaceOne.php
View file @
03e8038a
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
*/
*/
class
ReplaceOne
implements
Executable
class
ReplaceOne
implements
Executable
{
{
/** @var Update */
private
$update
;
private
$update
;
/**
/**
...
...
src/Operation/Update.php
View file @
03e8038a
...
@@ -43,14 +43,28 @@ use function MongoDB\server_supports_feature;
...
@@ -43,14 +43,28 @@ use function MongoDB\server_supports_feature;
*/
*/
class
Update
implements
Executable
,
Explainable
class
Update
implements
Executable
,
Explainable
{
{
/** @var integer */
private
static
$wireVersionForArrayFilters
=
6
;
private
static
$wireVersionForArrayFilters
=
6
;
/** @var integer */
private
static
$wireVersionForCollation
=
5
;
private
static
$wireVersionForCollation
=
5
;
/** @var integer */
private
static
$wireVersionForDocumentLevelValidation
=
4
;
private
static
$wireVersionForDocumentLevelValidation
=
4
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$collectionName
;
private
$collectionName
;
/** @var array|object */
private
$filter
;
private
$filter
;
/** @var array|object */
private
$update
;
private
$update
;
/** @var array */
private
$options
;
private
$options
;
/**
/**
...
...
src/Operation/UpdateMany.php
View file @
03e8038a
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
*/
*/
class
UpdateMany
implements
Executable
,
Explainable
class
UpdateMany
implements
Executable
,
Explainable
{
{
/** @var Update */
private
$update
;
private
$update
;
/**
/**
...
...
src/Operation/UpdateOne.php
View file @
03e8038a
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
...
@@ -36,6 +36,7 @@ use function MongoDB\is_pipeline;
*/
*/
class
UpdateOne
implements
Executable
,
Explainable
class
UpdateOne
implements
Executable
,
Explainable
{
{
/** @var Update */
private
$update
;
private
$update
;
/**
/**
...
...
src/Operation/Watch.php
View file @
03e8038a
...
@@ -54,21 +54,43 @@ use function MongoDB\server_supports_feature;
...
@@ -54,21 +54,43 @@ use function MongoDB\server_supports_feature;
*/
*/
class
Watch
implements
Executable
,
/* @internal */
CommandSubscriber
class
Watch
implements
Executable
,
/* @internal */
CommandSubscriber
{
{
private
static
$wireVersionForStartAtOperationTime
=
7
;
const
FULL_DOCUMENT_DEFAULT
=
'default'
;
const
FULL_DOCUMENT_DEFAULT
=
'default'
;
const
FULL_DOCUMENT_UPDATE_LOOKUP
=
'updateLookup'
;
const
FULL_DOCUMENT_UPDATE_LOOKUP
=
'updateLookup'
;
/** @var integer */
private
static
$wireVersionForStartAtOperationTime
=
7
;
/** @var Aggregate */
private
$aggregate
;
private
$aggregate
;
/** @var array */
private
$aggregateOptions
;
private
$aggregateOptions
;
/** @var array */
private
$changeStreamOptions
;
private
$changeStreamOptions
;
/** @var string|null */
private
$collectionName
;
private
$collectionName
;
/** @var string */
private
$databaseName
;
private
$databaseName
;
/** @var integer|null */
private
$firstBatchSize
;
private
$firstBatchSize
;
/** @var boolean */
private
$hasResumed
=
false
;
private
$hasResumed
=
false
;
/** @var Manager */
private
$manager
;
private
$manager
;
/** @var TimestampInterface */
private
$operationTime
;
private
$operationTime
;
/** @var array */
private
$pipeline
;
private
$pipeline
;
/** @var object|null */
private
$postBatchResumeToken
;
private
$postBatchResumeToken
;
/**
/**
...
...
src/UpdateResult.php
View file @
03e8038a
...
@@ -25,12 +25,12 @@ use MongoDB\Exception\BadMethodCallException;
...
@@ -25,12 +25,12 @@ use MongoDB\Exception\BadMethodCallException;
*/
*/
class
UpdateResult
class
UpdateResult
{
{
/** @var WriteResult */
private
$writeResult
;
private
$writeResult
;
/** @var boolean */
private
$isAcknowledged
;
private
$isAcknowledged
;
/**
* @param WriteResult $writeResult
*/
public
function
__construct
(
WriteResult
$writeResult
)
public
function
__construct
(
WriteResult
$writeResult
)
{
{
$this
->
writeResult
=
$writeResult
;
$this
->
writeResult
=
$writeResult
;
...
...
tests/ClientFunctionalTest.php
View file @
03e8038a
...
@@ -21,6 +21,7 @@ class ClientFunctionalTest extends FunctionalTestCase
...
@@ -21,6 +21,7 @@ class ClientFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Client */
private
$client
;
private
$client
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Collection/CrudSpecFunctionalTest.php
View file @
03e8038a
...
@@ -37,6 +37,7 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
...
@@ -37,6 +37,7 @@ class CrudSpecFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$expectedCollection
;
private
$expectedCollection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Collection/FunctionalTestCase.php
View file @
03e8038a
...
@@ -13,6 +13,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
...
@@ -13,6 +13,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
protected
$collection
;
protected
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/CommandObserver.php
View file @
03e8038a
...
@@ -16,6 +16,7 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
...
@@ -16,6 +16,7 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
*/
*/
class
CommandObserver
implements
CommandSubscriber
class
CommandObserver
implements
CommandSubscriber
{
{
/** @var array */
private
$commands
=
[];
private
$commands
=
[];
public
function
observe
(
callable
$execution
,
callable
$commandCallback
)
public
function
observe
(
callable
$execution
,
callable
$commandCallback
)
...
...
tests/Database/FunctionalTestCase.php
View file @
03e8038a
...
@@ -13,6 +13,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
...
@@ -13,6 +13,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Database */
protected
$database
;
protected
$database
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/FunctionalTestCase.php
View file @
03e8038a
...
@@ -34,8 +34,10 @@ abstract class FunctionalTestCase extends TestCase
...
@@ -34,8 +34,10 @@ abstract class FunctionalTestCase extends TestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Manager */
protected
$manager
;
protected
$manager
;
/** @var array */
private
$configuredFailPoints
=
[];
private
$configuredFailPoints
=
[];
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/GridFS/FunctionalTestCase.php
View file @
03e8038a
...
@@ -19,8 +19,13 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
...
@@ -19,8 +19,13 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Bucket */
protected
$bucket
;
protected
$bucket
;
/** @var Collection */
protected
$chunksCollection
;
protected
$chunksCollection
;
/** @var Collection */
protected
$filesCollection
;
protected
$filesCollection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/GridFS/ReadableStreamFunctionalTest.php
View file @
03e8038a
...
@@ -18,6 +18,7 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
...
@@ -18,6 +18,7 @@ class ReadableStreamFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var CollectionWrapper */
private
$collectionWrapper
;
private
$collectionWrapper
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/GridFS/SpecFunctionalTest.php
View file @
03e8038a
...
@@ -38,7 +38,10 @@ class SpecFunctionalTest extends FunctionalTestCase
...
@@ -38,7 +38,10 @@ class SpecFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$expectedChunksCollection
;
private
$expectedChunksCollection
;
/** @var Collection */
private
$expectedFilesCollection
;
private
$expectedFilesCollection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/GridFS/WritableStreamFunctionalTest.php
View file @
03e8038a
...
@@ -15,6 +15,7 @@ class WritableStreamFunctionalTest extends FunctionalTestCase
...
@@ -15,6 +15,7 @@ class WritableStreamFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var CollectionWrapper */
private
$collectionWrapper
;
private
$collectionWrapper
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Model/ChangeStreamIteratorTest.php
View file @
03e8038a
...
@@ -19,6 +19,7 @@ class ChangeStreamIteratorTest extends FunctionalTestCase
...
@@ -19,6 +19,7 @@ class ChangeStreamIteratorTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Model/IndexInfoFunctionalTest.php
View file @
03e8038a
...
@@ -11,6 +11,7 @@ class IndexInfoFunctionalTest extends FunctionalTestCase
...
@@ -11,6 +11,7 @@ class IndexInfoFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/BulkWriteFunctionalTest.php
View file @
03e8038a
...
@@ -19,6 +19,7 @@ class BulkWriteFunctionalTest extends FunctionalTestCase
...
@@ -19,6 +19,7 @@ class BulkWriteFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/DeleteFunctionalTest.php
View file @
03e8038a
...
@@ -16,6 +16,7 @@ class DeleteFunctionalTest extends FunctionalTestCase
...
@@ -16,6 +16,7 @@ class DeleteFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/InsertManyFunctionalTest.php
View file @
03e8038a
...
@@ -17,6 +17,7 @@ class InsertManyFunctionalTest extends FunctionalTestCase
...
@@ -17,6 +17,7 @@ class InsertManyFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/InsertOneFunctionalTest.php
View file @
03e8038a
...
@@ -17,6 +17,7 @@ class InsertOneFunctionalTest extends FunctionalTestCase
...
@@ -17,6 +17,7 @@ class InsertOneFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/UpdateFunctionalTest.php
View file @
03e8038a
...
@@ -17,6 +17,7 @@ class UpdateFunctionalTest extends FunctionalTestCase
...
@@ -17,6 +17,7 @@ class UpdateFunctionalTest extends FunctionalTestCase
{
{
use
SetUpTearDownTrait
;
use
SetUpTearDownTrait
;
/** @var Collection */
private
$collection
;
private
$collection
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/Operation/WatchFunctionalTest.php
View file @
03e8038a
...
@@ -36,8 +36,10 @@ class WatchFunctionalTest extends FunctionalTestCase
...
@@ -36,8 +36,10 @@ class WatchFunctionalTest extends FunctionalTestCase
const
INTERRUPTED
=
11601
;
const
INTERRUPTED
=
11601
;
const
NOT_MASTER
=
10107
;
const
NOT_MASTER
=
10107
;
/** @var integer */
private
static
$wireVersionForStartAtOperationTime
=
7
;
private
static
$wireVersionForStartAtOperationTime
=
7
;
/** @var array */
private
$defaultOptions
=
[
'maxAwaitTimeMS'
=>
500
];
private
$defaultOptions
=
[
'maxAwaitTimeMS'
=>
500
];
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/SpecTests/ChangeStreamsSpecTest.php
View file @
03e8038a
...
@@ -21,6 +21,7 @@ use function glob;
...
@@ -21,6 +21,7 @@ use function glob;
*/
*/
class
ChangeStreamsSpecTest
extends
FunctionalTestCase
class
ChangeStreamsSpecTest
extends
FunctionalTestCase
{
{
/** @var array */
private
static
$incompleteTests
=
[
'change-streams-errors: Change Stream should error when _id is projected out'
=>
'PHPC-1419'
];
private
static
$incompleteTests
=
[
'change-streams-errors: Change Stream should error when _id is projected out'
=>
'PHPC-1419'
];
/**
/**
...
...
tests/SpecTests/CommandExpectations.php
View file @
03e8038a
...
@@ -19,11 +19,22 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
...
@@ -19,11 +19,22 @@ use function MongoDB\Driver\Monitoring\removeSubscriber;
*/
*/
class
CommandExpectations
implements
CommandSubscriber
class
CommandExpectations
implements
CommandSubscriber
{
{
/** @var array */
private
$actualEvents
=
[];
private
$actualEvents
=
[];
/** @var array */
private
$expectedEvents
=
[];
private
$expectedEvents
=
[];
/** @var boolean */
private
$ignoreCommandFailed
=
false
;
private
$ignoreCommandFailed
=
false
;
/** @var boolean */
private
$ignoreCommandStarted
=
false
;
private
$ignoreCommandStarted
=
false
;
/** @var boolean */
private
$ignoreCommandSucceeded
=
false
;
private
$ignoreCommandSucceeded
=
false
;
/** @var boolean */
private
$ignoreExtraEvents
=
false
;
private
$ignoreExtraEvents
=
false
;
private
function
__construct
(
array
$events
)
private
function
__construct
(
array
$events
)
...
...
tests/SpecTests/Context.php
View file @
03e8038a
...
@@ -6,6 +6,7 @@ use LogicException;
...
@@ -6,6 +6,7 @@ use LogicException;
use
MongoDB\Client
;
use
MongoDB\Client
;
use
MongoDB\Driver\ReadConcern
;
use
MongoDB\Driver\ReadConcern
;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\ReadPreference
;
use
MongoDB\Driver\Session
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Driver\WriteConcern
;
use
stdClass
;
use
stdClass
;
use
function
array_diff_key
;
use
function
array_diff_key
;
...
@@ -21,18 +22,43 @@ use function mt_rand;
...
@@ -21,18 +22,43 @@ use function mt_rand;
*/
*/
final
class
Context
final
class
Context
{
{
/** @var string|null */
public
$bucketName
;
public
$bucketName
;
/** @var Client|null */
public
$client
;
public
$client
;
/** @var string */
public
$collectionName
;
public
$collectionName
;
/** @var string */
public
$databaseName
;
public
$databaseName
;
/** @var array */
public
$defaultWriteOptions
=
[];
public
$defaultWriteOptions
=
[];
/** @var array */
public
$outcomeFindOptions
=
[];
public
$outcomeFindOptions
=
[];
/** @var string */
public
$outcomeCollectionName
;
public
$outcomeCollectionName
;
/** @var Session|null */
public
$session0
;
public
$session0
;
/** @var object */
public
$session0Lsid
;
public
$session0Lsid
;
/** @var Session|null */
public
$session1
;
public
$session1
;
/** @var object */
public
$session1Lsid
;
public
$session1Lsid
;
/**
* @param string $databaseName
* @param string $collectionName
*/
private
function
__construct
(
$databaseName
,
$collectionName
)
private
function
__construct
(
$databaseName
,
$collectionName
)
{
{
$this
->
databaseName
=
$databaseName
;
$this
->
databaseName
=
$databaseName
;
...
...
tests/SpecTests/DocumentsMatchConstraint.php
View file @
03e8038a
...
@@ -29,15 +29,27 @@ class DocumentsMatchConstraint extends Constraint
...
@@ -29,15 +29,27 @@ class DocumentsMatchConstraint extends Constraint
{
{
use
ConstraintTrait
;
use
ConstraintTrait
;
/** @var boolean */
private
$ignoreExtraKeysInRoot
=
false
;
private
$ignoreExtraKeysInRoot
=
false
;
/** @var boolean */
private
$ignoreExtraKeysInEmbedded
=
false
;
private
$ignoreExtraKeysInEmbedded
=
false
;
/** @var array */
private
$placeholders
=
[];
private
$placeholders
=
[];
/* TODO: This is not currently used, but was preserved from the design of
/**
* TODO: This is not currently used, but was preserved from the design of
* TestCase::assertMatchesDocument(), which would sort keys and then compare
* TestCase::assertMatchesDocument(), which would sort keys and then compare
* documents as JSON strings. If the TODO item in matches() is implemented
* documents as JSON strings. If the TODO item in matches() is implemented
* to make document comparisons more efficient, we may consider supporting
* to make document comparisons more efficient, we may consider supporting
* this option. */
* this option.
*
* @var boolean
*/
private
$sortKeys
=
false
;
private
$sortKeys
=
false
;
/** @var BSONArray|BSONDocument */
private
$value
;
private
$value
;
/** @var ComparisonFailure|null */
/** @var ComparisonFailure|null */
...
...
tests/SpecTests/ErrorExpectation.php
View file @
03e8038a
...
@@ -21,6 +21,8 @@ final class ErrorExpectation
...
@@ -21,6 +21,8 @@ final class ErrorExpectation
{
{
/**
/**
* @see https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err
* @see https://github.com/mongodb/mongo/blob/master/src/mongo/base/error_codes.err
*
* @var array
*/
*/
private
static
$codeNameMap
=
[
private
static
$codeNameMap
=
[
'Interrupted'
=>
11601
,
'Interrupted'
=>
11601
,
...
@@ -29,11 +31,22 @@ final class ErrorExpectation
...
@@ -29,11 +31,22 @@ final class ErrorExpectation
'OperationNotSupportedInTransaction'
=>
263
,
'OperationNotSupportedInTransaction'
=>
263
,
];
];
/** @var integer */
private
$code
;
private
$code
;
/** @var string */
private
$codeName
;
private
$codeName
;
/** @var boolean */
private
$isExpected
=
false
;
private
$isExpected
=
false
;
/** @var string[] */
private
$excludedLabels
=
[];
private
$excludedLabels
=
[];
/** @var string[] */
private
$includedLabels
=
[];
private
$includedLabels
=
[];
/** @var string */
private
$messageContains
;
private
$messageContains
;
private
function
__construct
()
private
function
__construct
()
...
...
tests/SpecTests/FunctionalTestCase.php
View file @
03e8038a
...
@@ -33,6 +33,7 @@ class FunctionalTestCase extends BaseFunctionalTestCase
...
@@ -33,6 +33,7 @@ class FunctionalTestCase extends BaseFunctionalTestCase
const
TOPOLOGY_REPLICASET
=
'replicaset'
;
const
TOPOLOGY_REPLICASET
=
'replicaset'
;
const
TOPOLOGY_SHARDED
=
'sharded'
;
const
TOPOLOGY_SHARDED
=
'sharded'
;
/** @var Context|null */
private
$context
;
private
$context
;
private
function
doSetUp
()
private
function
doSetUp
()
...
...
tests/SpecTests/Operation.php
View file @
03e8038a
...
@@ -37,14 +37,28 @@ final class Operation
...
@@ -37,14 +37,28 @@ final class Operation
const
OBJECT_SESSION0
=
'session0'
;
const
OBJECT_SESSION0
=
'session0'
;
const
OBJECT_SESSION1
=
'session1'
;
const
OBJECT_SESSION1
=
'session1'
;
/** @var ErrorExpectation|null */
public
$errorExpectation
;
public
$errorExpectation
;
/** @var ResultExpectation|null */
public
$resultExpectation
;
public
$resultExpectation
;
/** @var array */
private
$arguments
=
[];
private
$arguments
=
[];
/** @var string|null */
private
$collectionName
;
private
$collectionName
;
/** @var array */
private
$collectionOptions
=
[];
private
$collectionOptions
=
[];
/** @var string|null */
private
$databaseName
;
private
$databaseName
;
/** @var string */
private
$name
;
private
$name
;
/** @var string */
private
$object
=
self
::
OBJECT_COLLECTION
;
private
$object
=
self
::
OBJECT_COLLECTION
;
private
function
__construct
(
stdClass
$operation
)
private
function
__construct
(
stdClass
$operation
)
...
...
tests/SpecTests/ResultExpectation.php
View file @
03e8038a
...
@@ -35,10 +35,19 @@ final class ResultExpectation
...
@@ -35,10 +35,19 @@ final class ResultExpectation
const
ASSERT_NULL
=
10
;
const
ASSERT_NULL
=
10
;
const
ASSERT_CALLABLE
=
11
;
const
ASSERT_CALLABLE
=
11
;
/** @var integer */
private
$assertionType
=
self
::
ASSERT_NOTHING
;
private
$assertionType
=
self
::
ASSERT_NOTHING
;
/** @var mixed */
private
$expectedValue
;
private
$expectedValue
;
/** @var callable */
private
$assertionCallable
;
private
$assertionCallable
;
/**
* @param integer $assertionType
* @param mixed $expectedValue
*/
private
function
__construct
(
$assertionType
,
$expectedValue
)
private
function
__construct
(
$assertionType
,
$expectedValue
)
{
{
switch
(
$assertionType
)
{
switch
(
$assertionType
)
{
...
...
tests/SpecTests/RetryableReadsSpecTest.php
View file @
03e8038a
...
@@ -16,6 +16,7 @@ use function strpos;
...
@@ -16,6 +16,7 @@ use function strpos;
*/
*/
class
RetryableReadsSpecTest
extends
FunctionalTestCase
class
RetryableReadsSpecTest
extends
FunctionalTestCase
{
{
/** @var array */
private
static
$skippedOperations
=
[
private
static
$skippedOperations
=
[
'listCollectionNames'
=>
'Not implemented'
,
'listCollectionNames'
=>
'Not implemented'
,
'listCollectionObjects'
=>
'Not implemented'
,
'listCollectionObjects'
=>
'Not implemented'
,
...
...
tests/SpecTests/TransactionsSpecTest.php
View file @
03e8038a
...
@@ -27,8 +27,12 @@ class TransactionsSpecTest extends FunctionalTestCase
...
@@ -27,8 +27,12 @@ class TransactionsSpecTest extends FunctionalTestCase
const
INTERRUPTED
=
11601
;
const
INTERRUPTED
=
11601
;
/* In addition to the useMultipleMongoses tests, these should all pass
/**
* before the driver can be considered compatible with MongoDB 4.2. */
* In addition to the useMultipleMongoses tests, these should all pass
* before the driver can be considered compatible with MongoDB 4.2.
*
* @var array
*/
private
static
$incompleteTests
=
[
private
static
$incompleteTests
=
[
'error-labels: add unknown commit label to MaxTimeMSExpired'
=>
'PHPC-1382'
,
'error-labels: add unknown commit label to MaxTimeMSExpired'
=>
'PHPC-1382'
,
'error-labels: add unknown commit label to writeConcernError MaxTimeMSExpired'
=>
'PHPC-1382'
,
'error-labels: add unknown commit label to writeConcernError MaxTimeMSExpired'
=>
'PHPC-1382'
,
...
...
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