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