Skip to content

Commit 903e101

Browse files
authored
PHPLIB-674 Revise documentation for installing coding standard (#838)
* Remove workaround due to doctrine/coding-standard being incompatible * Update to doctrine/coding-standard 9.0 and phpcs 3.6 * phpcbf: fix SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/Operation/FunctionalTestCase.php 2 0 src/Operation/ListCollectionNames.php 1 0 tests/GridFS/FunctionalTestCase.php 1 0 tests/Operation/DeleteFunctionalTest.php 1 0 tests/ClientFunctionalTest.php 1 0 tests/UnifiedSpecTests/Util.php 4 0 src/GridFS/Exception/StreamException.php 3 0 tests/Operation/InsertManyFunctionalTest.php 1 0 tests/UnifiedSpecTests/EventCollector.php 2 0 tests/Operation/InsertOneFunctionalTest.php 1 0 tests/Database/FunctionalTestCase.php 1 0 tests/Model/ChangeStreamIteratorTest.php 1 0 tests/UnifiedSpecTests/UnifiedTestCase.php 2 0 tests/SpecTests/AtlasDataLakeSpecTest.php 2 0 tests/SpecTests/PrimaryStepDownSpecTest.php 1 0 tests/Operation/UpdateFunctionalTest.php 1 0 src/Model/ChangeStreamIterator.php 1 0 tests/UnifiedSpecTests/EventObserver.php 1 0 src/Operation/ListDatabaseNames.php 1 0 src/Operation/FindAndModify.php 2 0 tests/UnifiedSpecTests/RunOnRequirement.php 1 0 tests/UnifiedSpecTests/EntityMap.php 7 0 tests/TestCase.php 1 0 src/GridFS/CollectionWrapper.php 1 0 tests/SpecTests/FunctionalTestCase.php 2 0 tests/Operation/BulkWriteFunctionalTest.php 1 0 tests/Model/IndexInfoFunctionalTest.php 2 0 tests/UnifiedSpecTests/UnifiedSpecTest.php 3 0 src/Operation/Aggregate.php 3 0 tests/GridFS/WritableStreamFunctionalTest.php 1 0 tests/UnifiedSpecTests/UnifiedTestRunner.php 8 0 tests/Operation/MapReduceFunctionalTest.php 2 0 src/Client.php 3 0 tests/SpecTests/Context.php 3 0 src/Operation/EstimatedDocumentCount.php 2 0 tests/UnifiedSpecTests/Context.php 14 0 tests/SpecTests/TransactionsSpecTest.php 2 0 src/Database.php 1 0 tests/UnifiedSpecTests/DirtySessionObserver.php 1 0 tests/Collection/CrudSpecFunctionalTest.php 1 0 tests/Collection/FunctionalTestCase.php 2 0 tests/GridFS/ReadableStreamFunctionalTest.php 1 0 tests/UnifiedSpecTests/Operation.php 4 0 tests/UnifiedSpecTests/Constraint/Matches.php 3 0 tests/FunctionalTestCase.php 5 0 tests/UnifiedSpecTests/Loop.php 1 0 tests/UnifiedSpecTests/Constraint/IsBsonType.php 7 0 tests/SpecTests/ClientSideEncryptionSpecTest.php 1 0 tests/DocumentationExamplesTest.php 2 0 tests/Operation/WatchFunctionalTest.php 1 0 tests/PHPUnit/Functions.php 58 0 tests/GridFS/StreamWrapperFunctionalTest.php 1 0 ---------------------------------------------------------------------- A TOTAL OF 175 ERRORS WERE FIXED IN 52 FILES ---------------------------------------------------------------------- Time: 9.53 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.Namespaces.UseSpacing PHPCBF RESULT SUMMARY -------------------------------------------------------------------------- FILE FIXED REMAINING -------------------------------------------------------------------------- tests/Operation/DatabaseCommandFunctionalTest.php 1 0 src/Exception/BadMethodCallException.php 1 0 src/GridFS/Exception/FileNotFoundException.php 1 0 tests/Operation/ModifyCollectionFunctionalTest.php 1 0 src/Model/IndexInfoIteratorIterator.php 1 0 tests/Operation/DeleteTest.php 1 0 src/Exception/InvalidArgumentException.php 1 0 tests/CommandObserver.php 1 0 tests/Operation/CreateCollectionFunctionalTest.php 1 0 src/MapReduceResult.php 1 0 tests/GridFS/FunctionalTestCase.php 1 0 src/Operation/WithTransaction.php 1 0 src/Operation/ReplaceOne.php 1 0 src/Operation/FindOneAndDelete.php 1 0 src/Model/DatabaseInfo.php 1 0 src/Operation/DatabaseCommand.php 1 0 src/Operation/UpdateMany.php 1 0 tests/UnifiedSpecTests/CollectionData.php 1 0 src/Operation/UpdateOne.php 1 0 tests/Operation/ListDatabasesFunctionalTest.php 1 0 tests/Operation/CountFunctionalTest.php 1 0 tests/Operation/DropDatabaseFunctionalTest.php 1 0 src/Operation/DropDatabase.php 1 0 tests/Operation/ListDatabaseNamesFunctionalTest.php 1 0 tests/Operation/DropCollectionFunctionalTest.php 1 0 tests/Operation/ListCollectionsFunctionalTest.php 1 0 src/Model/CachingIterator.php 1 0 tests/GridFS/UnusableStream.php 1 0 tests/Operation/DeleteFunctionalTest.php 1 0 tests/UnifiedSpecTests/Util.php 1 0 tests/ClientFunctionalTest.php 1 0 src/Operation/CountDocuments.php 1 0 src/Operation/DropCollection.php 1 0 tests/Model/BSONArrayTest.php 1 0 tests/Database/CollectionManagementFunctionalTest.php 1 0 src/Model/CollectionInfo.php 1 0 src/Model/BSONDocument.php 1 0 src/Model/IndexInfo.php 1 0 tests/Operation/DistinctFunctionalTest.php 1 0 tests/UnifiedSpecTests/EventCollector.php 1 0 tests/Operation/InsertManyFunctionalTest.php 1 0 tests/Operation/InsertOneFunctionalTest.php 1 0 src/Operation/FindOne.php 1 0 tests/Model/BSONIteratorTest.php 1 0 src/Operation/Delete.php 1 0 tests/Model/ChangeStreamIteratorTest.php 1 0 tests/FunctionsTest.php 1 0 tests/SpecTests/CommandExpectations.php 1 0 tests/PedantryTest.php 2 0 tests/SpecTests/DocumentsMatchConstraintTest.php 2 0 src/Operation/ListIndexes.php 1 0 src/Model/IndexInput.php 1 0 tests/SpecTests/AtlasDataLakeSpecTest.php 1 0 tests/UnifiedSpecTests/UnifiedTestCase.php 1 0 src/Model/BSONIterator.php 1 0 tests/Operation/FindFunctionalTest.php 1 0 src/GridFS/WritableStream.php 1 0 tests/SpecTests/PrimaryStepDownSpecTest.php 1 0 tests/Model/BSONDocumentTest.php 1 0 src/Operation/FindOneAndUpdate.php 1 0 src/GridFS/StreamWrapper.php 2 0 tests/SpecTests/ChangeStreamsSpecTest.php 1 0 tests/Operation/UpdateFunctionalTest.php 1 0 tests/UnifiedSpecTests/EventObserver.php 1 0 tests/Operation/DropIndexesFunctionalTest.php 1 0 src/Operation/DropIndexes.php 1 0 src/Model/ChangeStreamIterator.php 1 0 src/GridFS/Exception/CorruptFileException.php 1 0 src/Operation/Count.php 1 0 src/Operation/Distinct.php 1 0 src/Model/BSONArray.php 1 0 tests/Operation/FindAndModifyFunctionalTest.php 1 0 src/functions.php 1 0 tests/Operation/ListCollectionNamesFunctionalTest.php 1 0 tests/UnifiedSpecTests/RunOnRequirement.php 1 0 src/Operation/FindAndModify.php 1 0 tests/SpecTests/ReadWriteConcernSpecTest.php 1 0 tests/TestCase.php 2 0 tests/SpecTests/RetryableReadsSpecTest.php 1 0 tests/UnifiedSpecTests/Constraint/MatchesTest.php 1 0 tests/UnifiedSpecTests/EntityMap.php 1 0 src/GridFS/Exception/StreamException.php 1 0 tests/Model/CachingIteratorTest.php 1 0 tests/Operation/CreateIndexesFunctionalTest.php 1 0 src/GridFS/CollectionWrapper.php 1 0 src/Operation/Update.php 1 0 tests/Model/IndexInfoFunctionalTest.php 1 0 src/Operation/CreateCollection.php 2 0 tests/Operation/BulkWriteFunctionalTest.php 1 0 tests/Operation/ListIndexesFunctionalTest.php 1 0 src/Operation/Aggregate.php 1 0 tests/UnifiedSpecTests/FailPointObserver.php 1 0 src/Operation/Find.php 2 0 src/Operation/CreateIndexes.php 1 0 tests/UnifiedSpecTests/UnifiedTestRunner.php 1 0 src/Client.php 1 0 tests/Operation/MapReduceFunctionalTest.php 1 0 src/Operation/InsertOne.php 1 0 src/Operation/InsertMany.php 1 0 tests/SpecTests/Context.php 1 0 tests/SpecTests/ResultExpectation.php 1 0 src/Operation/EstimatedDocumentCount.php 1 0 tests/UnifiedSpecTests/Context.php 2 0 src/Operation/FindOneAndReplace.php 1 0 src/Operation/Explain.php 1 0 tests/Database/DatabaseFunctionalTest.php 1 0 src/GridFS/ReadableStream.php 1 0 tests/SpecTests/FunctionalTestCase.php 1 0 tests/UnifiedSpecTests/Constraint/IsBsonTypeTest.php 2 0 tests/UnifiedSpecTests/ExpectedResult.php 1 0 tests/Operation/ExplainFunctionalTest.php 1 0 tests/Collection/CollectionFunctionalTest.php 1 0 src/Operation/ModifyCollection.php 1 0 tests/Operation/AggregateFunctionalTest.php 1 0 tests/SpecTests/TransactionsSpecTest.php 1 0 src/Database.php 1 0 tests/UnifiedSpecTests/Constraint/Matches.php 2 0 tests/UnifiedSpecTests/ExpectedError.php 1 0 tests/SpecTests/ErrorExpectation.php 1 0 src/Operation/Watch.php 1 0 src/Operation/MapReduce.php 2 0 tests/UnifiedSpecTests/UnifiedSpecTest.php 1 0 tests/UnifiedSpecTests/Operation.php 1 0 tests/UnifiedSpecTests/DirtySessionObserver.php 1 0 tests/SpecTests/RetryableWritesSpecTest.php 1 0 tests/FunctionalTestCase.php 2 0 src/Operation/BulkWrite.php 1 0 tests/GridFS/BucketFunctionalTest.php 2 0 src/ChangeStream.php 1 0 src/Operation/ListDatabaseNames.php 1 0 tests/UnifiedSpecTests/Constraint/IsBsonType.php 2 0 tests/UnifiedSpecTests/Loop.php 1 0 tests/GridFS/WritableStreamFunctionalTest.php 1 0 tests/SpecTests/DocumentsMatchConstraint.php 2 0 tests/Collection/CrudSpecFunctionalTest.php 1 0 tests/SpecTests/ClientSideEncryptionSpecTest.php 1 0 tests/SpecTests/Operation.php 1 0 tests/GridFS/ReadableStreamFunctionalTest.php 1 0 src/GridFS/Bucket.php 1 0 tests/SpecTests/CommandMonitoringSpecTest.php 1 0 tests/Operation/WatchFunctionalTest.php 1 0 tests/DocumentationExamplesTest.php 1 0 src/Collection.php 1 0 src/Command/ListCollections.php 1 0 src/Command/ListDatabases.php 1 0 tests/PHPUnit/Functions.php 1 0 tests/GridFS/StreamWrapperFunctionalTest.php 2 0 -------------------------------------------------------------------------- A TOTAL OF 162 ERRORS WERE FIXED IN 147 FILES -------------------------------------------------------------------------- Time: 11.55 secs; Memory: 10MB * phpcbf: fix PSR12.ControlStructures.ControlStructureSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- src/Operation/WithTransaction.php 3 0 src/Operation/DropCollection.php 2 0 src/Operation/FindOneAndUpdate.php 2 0 src/Operation/InsertOne.php 1 0 tests/UnifiedSpecTests/ExpectedResult.php 2 0 src/Operation/Update.php 2 0 src/Operation/FindAndModify.php 1 0 src/Operation/InsertMany.php 1 0 src/Operation/Aggregate.php 1 0 src/Operation/FindOneAndReplace.php 2 0 src/Operation/Find.php 2 0 src/Operation/Watch.php 4 0 tests/SpecTests/DocumentsMatchConstraint.php 2 0 src/Database.php 3 0 src/Operation/MapReduce.php 1 0 src/Operation/BulkWrite.php 1 0 src/Collection.php 3 0 ---------------------------------------------------------------------- A TOTAL OF 33 ERRORS WERE FIXED IN 17 FILES ---------------------------------------------------------------------- Time: 6.46 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- src/Model/ChangeStreamIterator.php 2 0 tests/SpecTests/ChangeStreamsSpecTest.php 3 0 tests/UnifiedSpecTests/EventObserver.php 3 0 tests/UnifiedSpecTests/Constraint/IsBsonType.php 21 0 tests/Collection/CrudSpecFunctionalTest.php 14 0 tests/UnifiedSpecTests/Operation.php 42 0 tests/SpecTests/DocumentsMatchConstraint.php 19 0 src/GridFS/Bucket.php 1 0 tests/SpecTests/Operation.php 79 0 tests/DocumentationExamplesTest.php 8 0 ---------------------------------------------------------------------- A TOTAL OF 192 ERRORS WERE FIXED IN 10 FILES ---------------------------------------------------------------------- Time: 5.07 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.ControlStructures.BlockControlStructureSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/ClientFunctionalTest.php 1 0 tests/PedantryTest.php 2 0 src/functions.php 1 0 tests/SpecTests/ResultExpectation.php 7 0 tests/UnifiedSpecTests/UnifiedSpecTest.php 1 0 src/Operation/Aggregate.php 1 0 tests/SpecTests/TransactionsSpecTest.php 1 0 src/Operation/Find.php 2 0 tests/SpecTests/ErrorExpectation.php 5 0 src/Operation/MapReduce.php 1 0 tests/FunctionalTestCase.php 8 0 tests/Collection/CrudSpecFunctionalTest.php 8 0 tests/UnifiedSpecTests/Operation.php 2 0 tests/SpecTests/Operation.php 4 0 tests/DocumentationExamplesTest.php 17 0 ---------------------------------------------------------------------- A TOTAL OF 61 ERRORS WERE FIXED IN 15 FILES ---------------------------------------------------------------------- Time: 5.32 secs; Memory: 10MB * phpcbf: fix PSR12.Operators.OperatorSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/FunctionalTestCase.php 2 0 tests/UnifiedSpecTests/Operation.php 1 0 ---------------------------------------------------------------------- A TOTAL OF 3 ERRORS WERE FIXED IN 2 FILES ---------------------------------------------------------------------- Time: 4.97 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.Arrays.SingleLineArrayWhitespace PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/Collection/CrudSpecFunctionalTest.php 3 0 tests/DocumentationExamplesTest.php 30 0 tests/UnifiedSpecTests/Operation.php 2 0 tests/SpecTests/Operation.php 3 0 tests/Operation/WatchFunctionalTest.php 3 0 ---------------------------------------------------------------------- A TOTAL OF 41 ERRORS WERE FIXED IN 5 FILES ---------------------------------------------------------------------- Time: 4.96 secs; Memory: 10MB * phpcbf: fix remaining fixable errors PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- src/Model/BSONIterator.php 2 0 src/GridFS/ReadableStream.php 1 0 tests/Operation/WatchFunctionalTest.php 1 0 tests/PHPUnit/Functions.php 1 0 ---------------------------------------------------------------------- A TOTAL OF 5 ERRORS WERE FIXED IN 4 FILES ---------------------------------------------------------------------- Time: 9.68 secs; Memory: 10MB * manual: fix Squiz.NamingConventions.ValidVariableName * phpcbf: use native type hints in tests PHPCBF RESULT SUMMARY -------------------------------------------------------------------------- FILE FIXED REMAINING -------------------------------------------------------------------------- tests/Operation/DatabaseCommandFunctionalTest.php 3 0 tests/Operation/DropDatabaseTest.php 1 0 tests/Operation/ExplainTest.php 1 0 tests/Operation/ModifyCollectionTest.php 2 0 tests/Operation/ModifyCollectionFunctionalTest.php 1 0 tests/CommandObserver.php 4 0 tests/Operation/DeleteTest.php 3 0 tests/Operation/CountDocumentsTest.php 2 0 tests/Operation/UpdateManyTest.php 4 0 tests/Operation/CountTest.php 2 0 tests/Model/DatabaseInfoTest.php 7 0 tests/Operation/CreateIndexesTest.php 4 0 tests/GridFS/FunctionalTestCase.php 3 0 tests/Operation/InsertManyTest.php 4 0 tests/Model/IndexInputTest.php 6 0 tests/Operation/FindAndModifyTest.php 2 0 tests/Operation/ListIndexesTest.php 1 0 tests/UnifiedSpecTests/CollectionData.php 2 0 tests/Operation/ListDatabasesFunctionalTest.php 10 0 tests/Operation/DropDatabaseFunctionalTest.php 10 0 tests/Operation/CreateCollectionFunctionalTest.php 6 0 tests/Operation/FindOneAndUpdateTest.php 5 0 tests/Operation/CountFunctionalTest.php 7 0 tests/Operation/DeleteFunctionalTest.php 8 0 tests/GridFS/UnusableStream.php 2 0 tests/ClientFunctionalTest.php 9 0 tests/UnifiedSpecTests/Util.php 1 0 tests/Database/CollectionManagementFunctionalTest.php 10 0 tests/Operation/UpdateOneTest.php 4 0 tests/Operation/DropIndexesTest.php 2 0 tests/Operation/ListCollectionsFunctionalTest.php 6 0 tests/Operation/FindTest.php 8 0 tests/Operation/DistinctTest.php 2 0 tests/Operation/ListDatabaseNamesFunctionalTest.php 10 0 tests/Operation/FindOneAndReplaceTest.php 5 0 tests/Operation/DropCollectionFunctionalTest.php 10 0 tests/UnifiedSpecTests/EventCollector.php 6 0 tests/Operation/InsertManyFunctionalTest.php 12 0 tests/Operation/MapReduceTest.php 2 0 tests/Model/BSONArrayTest.php 7 0 tests/Operation/InsertOneTest.php 2 0 tests/Operation/DropCollectionTest.php 1 0 tests/Operation/EstimatedDocumentCountTest.php 1 0 tests/FunctionsTest.php 8 0 tests/Model/IndexInfoTest.php 11 0 tests/SpecTests/DocumentsMatchConstraintTest.php 6 0 tests/PedantryTest.php 1 0 tests/SpecTests/CommandExpectations.php 6 0 tests/Operation/ReplaceOneTest.php 4 0 tests/Operation/InsertOneFunctionalTest.php 13 0 tests/Operation/WatchTest.php 3 0 tests/SpecTests/AtlasDataLakeSpecTest.php 10 0 tests/Operation/FindFunctionalTest.php 12 0 tests/Command/ListDatabasesTest.php 1 0 tests/SpecTests/PrimaryStepDownSpecTest.php 9 0 tests/Operation/UpdateTest.php 3 0 tests/Model/ChangeStreamIteratorTest.php 12 0 tests/Operation/DistinctFunctionalTest.php 7 0 tests/Operation/UpdateFunctionalTest.php 19 0 tests/Operation/DatabaseCommandTest.php 2 0 tests/SpecTests/ChangeStreamsSpecTest.php 14 0 tests/UnifiedSpecTests/EventObserver.php 10 0 tests/Command/ListCollectionsTest.php 1 0 tests/Model/BSONDocumentTest.php 8 0 tests/Operation/ListCollectionNamesFunctionalTest.php 4 0 tests/Operation/DropIndexesFunctionalTest.php 11 0 tests/SpecTests/ReadWriteConcernSpecTest.php 4 0 tests/Model/BSONIteratorTest.php 5 0 tests/Model/CollectionInfoTest.php 7 0 tests/UnifiedSpecTests/Constraint/MatchesTest.php 12 0 tests/UnifiedSpecTests/EntityMap.php 3 0 tests/TestCase.php 28 0 tests/SpecTests/RetryableReadsSpecTest.php 5 0 tests/Operation/CountDocumentsFunctionalTest.php 2 0 tests/Operation/AggregateTest.php 3 0 tests/Operation/CreateIndexesFunctionalTest.php 27 0 tests/Operation/BulkWriteFunctionalTest.php 22 0 tests/Model/CachingIteratorTest.php 12 0 tests/UnifiedSpecTests/FailPointObserver.php 6 0 tests/Operation/FindOneAndDeleteTest.php 2 0 tests/Model/IndexInfoFunctionalTest.php 3 0 tests/Operation/BulkWriteTest.php 36 0 tests/UnifiedSpecTests/UnifiedTestRunner.php 10 0 tests/Operation/MapReduceFunctionalTest.php 23 0 tests/SpecTests/ResultExpectation.php 3 0 tests/UnifiedSpecTests/Context.php 16 0 tests/Database/DatabaseFunctionalTest.php 18 0 tests/Operation/CreateCollectionTest.php 4 0 tests/SpecTests/FunctionalTestCase.php 18 0 tests/UnifiedSpecTests/Constraint/IsBsonTypeTest.php 10 0 tests/UnifiedSpecTests/ExpectedResult.php 1 0 tests/Collection/CollectionFunctionalTest.php 44 0 tests/Operation/AggregateFunctionalTest.php 32 0 tests/Operation/FindAndModifyFunctionalTest.php 18 0 tests/SpecTests/Context.php 8 0 tests/SpecTests/TransactionsSpecTest.php 9 0 tests/Operation/FindOneFunctionalTest.php 3 0 tests/Operation/ListIndexesFunctionalTest.php 5 0 tests/Operation/ExplainFunctionalTest.php 31 0 tests/UnifiedSpecTests/ExpectedError.php 2 0 tests/UnifiedSpecTests/Constraint/Matches.php 6 0 tests/UnifiedSpecTests/UnifiedSpecTest.php 8 0 tests/UnifiedSpecTests/Operation.php 2 0 tests/UnifiedSpecTests/DirtySessionObserver.php 5 0 tests/GridFS/BucketFunctionalTest.php 65 0 tests/SpecTests/ErrorExpectation.php 2 0 tests/UnifiedSpecTests/Loop.php 5 0 tests/SpecTests/RetryableWritesSpecTest.php 1 0 tests/GridFS/WritableStreamFunctionalTest.php 5 0 tests/SpecTests/DocumentsMatchConstraint.php 9 0 tests/FunctionalTestCase.php 16 0 tests/Collection/CrudSpecFunctionalTest.php 11 0 tests/SpecTests/ClientSideEncryptionSpecTest.php 35 0 tests/SpecTests/Operation.php 8 0 tests/ClientTest.php 13 0 tests/GridFS/ReadableStreamFunctionalTest.php 19 0 tests/SpecTests/CommandMonitoringSpecTest.php 6 0 tests/DocumentationExamplesTest.php 35 0 tests/Operation/WatchFunctionalTest.php 80 0 tests/PHPUnit/Functions.php 141 0 tests/GridFS/StreamWrapperFunctionalTest.php 13 0 -------------------------------------------------------------------------- A TOTAL OF 1290 ERRORS WERE FIXED IN 121 FILES -------------------------------------------------------------------------- Time: 23.19 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue Despite the method signatures changing, this change is acceptable as it does not create a BC break: https://3v4l.org/vN1M9 PHPCBF RESULT SUMMARY -------------------------------------------------------------------------- FILE FIXED REMAINING -------------------------------------------------------------------------- tests/ClientFunctionalTest.php 1 0 tests/Database/CollectionManagementFunctionalTest.php 1 0 tests/UnifiedSpecTests/UnifiedTestCase.php 3 0 tests/SpecTests/ReadWriteConcernSpecTest.php 3 0 tests/Model/BSONIteratorTest.php 1 0 tests/Operation/DropIndexesFunctionalTest.php 1 0 tests/SpecTests/AtlasDataLakeSpecTest.php 3 0 tests/UnifiedSpecTests/EntityMap.php 2 0 tests/SpecTests/PrimaryStepDownSpecTest.php 1 0 tests/SpecTests/ChangeStreamsSpecTest.php 4 0 tests/Operation/CreateIndexesFunctionalTest.php 1 0 tests/Operation/FindAndModifyFunctionalTest.php 1 0 tests/SpecTests/RetryableReadsSpecTest.php 1 0 tests/Operation/MapReduceFunctionalTest.php 2 0 tests/UnifiedSpecTests/UnifiedTestRunner.php 3 0 tests/SpecTests/ErrorExpectation.php 2 0 tests/Operation/AggregateFunctionalTest.php 2 0 tests/SpecTests/RetryableWritesSpecTest.php 1 0 tests/UnifiedSpecTests/Context.php 1 0 tests/UnifiedSpecTests/ExpectedResult.php 2 0 tests/UnifiedSpecTests/Constraint/Matches.php 1 0 tests/SpecTests/FunctionalTestCase.php 1 0 tests/FunctionalTestCase.php 6 0 tests/SpecTests/TransactionsSpecTest.php 3 0 tests/Collection/CrudSpecFunctionalTest.php 2 0 tests/UnifiedSpecTests/ExpectedError.php 2 0 tests/GridFS/BucketFunctionalTest.php 1 0 tests/SpecTests/ClientSideEncryptionSpecTest.php 5 0 tests/SpecTests/CommandMonitoringSpecTest.php 2 0 tests/PHPUnit/Functions.php 2 0 -------------------------------------------------------------------------- A TOTAL OF 61 ERRORS WERE FIXED IN 30 FILES -------------------------------------------------------------------------- Time: 19.24 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.PHP.ShortList PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/UnifiedSpecTests/CollectionData.php 1 0 src/Model/BSONIterator.php 1 0 tests/UnifiedSpecTests/FailPointObserver.php 1 0 tests/SpecTests/CommandExpectations.php 2 0 tests/SpecTests/AtlasDataLakeSpecTest.php 1 0 tests/SpecTests/ChangeStreamsSpecTest.php 1 0 tests/UnifiedSpecTests/EventObserver.php 1 0 src/GridFS/CollectionWrapper.php 2 0 tests/UnifiedSpecTests/Context.php 1 0 tests/SpecTests/FunctionalTestCase.php 1 0 tests/FunctionalTestCase.php 2 0 tests/Collection/CrudSpecFunctionalTest.php 1 0 ---------------------------------------------------------------------- A TOTAL OF 15 ERRORS WERE FIXED IN 12 FILES ---------------------------------------------------------------------- Time: 10.33 secs; Memory: 10MB * phpcbf: fix SlevomatCodingStandard.Classes.ClassConstantVisibility PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/UnifiedSpecTests/RunOnRequirement.php 5 0 src/Operation/FindOneAndUpdate.php 2 0 src/Operation/FindOneAndReplace.php 2 0 tests/SpecTests/PrimaryStepDownSpecTest.php 3 0 src/Operation/CreateCollection.php 2 0 tests/SpecTests/FunctionalTestCase.php 3 0 tests/SpecTests/ResultExpectation.php 13 0 tests/UnifiedSpecTests/UnifiedTestRunner.php 5 0 tests/SpecTests/TransactionsSpecTest.php 1 0 src/Operation/Find.php 3 0 src/ChangeStream.php 1 0 src/Operation/Explain.php 3 0 src/Operation/Watch.php 2 0 tests/UnifiedSpecTests/Operation.php 1 0 src/Operation/BulkWrite.php 6 0 tests/SpecTests/Operation.php 9 0 tests/SpecTests/ClientSideEncryptionSpecTest.php 1 0 tests/Operation/WatchFunctionalTest.php 2 0 ---------------------------------------------------------------------- A TOTAL OF 64 ERRORS WERE FIXED IN 18 FILES ---------------------------------------------------------------------- Time: 11.12 secs; Memory: 10MB * Sort php version specific sniffs to the top * phpcbf: fix SlevomatCodingStandard.Namespaces.NamespaceSpacing PHPCBF RESULT SUMMARY ---------------------------------------------------------------------- FILE FIXED REMAINING ---------------------------------------------------------------------- tests/PHPUnit/Functions.php 1 0 ---------------------------------------------------------------------- A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE ---------------------------------------------------------------------- Time: 17.97 secs; Memory: 10MB * manual: fix SlevomatCodingStandard.TypeHints.*TypeHint.MissingAnyTypeHint * Remove obsolete configuration This is now enabled by default in doctrine/coding-standard * Clean up and document phpcs configuration file * Fix wrong method signature for inherited method * Remove wrong return type * manual: Use native typehints for internal functions * Make collectionName argument nullable Some tests don't have a collection name, which the previous documentation didn't cover for.
1 parent fca066e commit 903e101

File tree

196 files changed

+2303
-1653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+2303
-1653
lines changed

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ jobs:
6060
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
6161
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"
6262

63-
- name: "Require doctrine/coding-standard"
64-
run: "composer require --no-update doctrine/coding-standard=^6.0"
65-
6663
- name: "Install dependencies with Composer"
6764
run: "composer install --no-interaction --no-progress --no-suggest"
6865

.phpcs/autoload.php

Lines changed: 0 additions & 15 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,8 @@ $ SYMFONY_PHPUNIT_VERSION=7.5 vendor/bin/simple-phpunit
4747
## Checking coding standards
4848

4949
The library's code is checked using [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer),
50-
which is installed as a development dependency by Composer. Due to the PHP
51-
requirement, the base version of the coding standard is not installed and needs
52-
to be added manually if you plan to contributing code:
53-
54-
```
55-
$ composer require --dev doctrine/coding-standard=^6.0
56-
```
57-
58-
Once the coding standard has been installed, you can check the code for style
59-
errors:
50+
which is installed as a development dependency by Composer. To check the code
51+
for style errors, run the `phpcs` binary:
6052

6153

6254
```

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"symfony/polyfill-php80": "^1.19"
1818
},
1919
"require-dev": {
20-
"squizlabs/php_codesniffer": "^3.5, <3.5.5",
20+
"squizlabs/php_codesniffer": "^3.6",
21+
"doctrine/coding-standard": "^9.0",
2122
"symfony/phpunit-bridge": "^5.2"
2223
},
2324
"autoload": {

phpcs.xml.dist

Lines changed: 118 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,90 @@
11
<?xml version="1.0"?>
22
<ruleset>
3-
<arg name="basepath" value="."/>
4-
<arg name="extensions" value="php"/>
5-
<arg name="parallel" value="80"/>
6-
<arg name="cache" value=".phpcs-cache"/>
3+
<arg name="basepath" value="." />
4+
<arg name="extensions" value="php" />
5+
<arg name="parallel" value="80" />
6+
<arg name="cache" value=".phpcs-cache" />
77
<arg name="colors" />
88

9-
<!-- Ignore warnings, show progress of the run, and show sniff names -->
9+
<!-- Ignore warnings (n), show progress of the run (p), and show sniff names (s) -->
1010
<arg value="nps"/>
1111

12-
<autoload>.phpcs/autoload.php</autoload>
13-
14-
<file>.phpcs</file>
1512
<file>src</file>
1613
<file>tests</file>
1714

15+
<!-- ****************************************** -->
16+
<!-- Import rules from doctrine/coding-standard -->
17+
<!-- ****************************************** -->
1818
<rule ref="Doctrine">
19+
<!-- ********************************************** -->
1920
<!-- Exclude sniffs that require newer PHP versions -->
20-
<!-- Available with PHP 7.1 -->
21-
<exclude name="SlevomatCodingStandard.Classes.ClassConstantVisibility" />
22-
<exclude name="SlevomatCodingStandard.PHP.ShortList.LongListUsed" />
23-
<exclude name="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
21+
<!-- ********************************************** -->
2422

25-
<!-- Can cause subtle BC breaks, disabled for now -->
26-
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" />
23+
<!-- Requires PHP 7.4 -->
24+
<exclude name="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator" />
2725

28-
<!-- No statement alignment so far -->
29-
<exclude name="Generic.Formatting.MultipleStatementAlignment" />
26+
<!-- Requires PHP 8.0 -->
27+
<exclude name="SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall" />
3028

31-
<!-- Class naming sniffs are excluded to preserve BC -->
29+
30+
<!-- *********************************** -->
31+
<!-- Exclude sniffs that cause BC breaks -->
32+
<!-- *********************************** -->
3233
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming" />
3334
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming" />
3435
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming" />
3536
<exclude name="SlevomatCodingStandard.Classes.SuperfluousTraitNaming" />
3637

37-
<!-- Forbid useless annotations - Git and LICENCE file provide more accurate information -->
38-
<!-- Disable forbidden annotation sniff as excluding @api from the list doesn't work -->
39-
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden" />
38+
<!-- Can cause subtle BC breaks -->
39+
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" />
40+
41+
42+
<!-- **************************************** -->
43+
<!-- Exclude sniffs that force unwanted style -->
44+
<!-- **************************************** -->
45+
<exclude name="Generic.Formatting.MultipleStatementAlignment" />
46+
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />
4047

4148
<!-- Keep long typehints (for now) -->
49+
<exclude name="PSR12.Keywords.ShortFormTypeKeywords" />
4250
<exclude name="SlevomatCodingStandard.PHP.TypeCast.InvalidCastUsed" />
4351
<exclude name="SlevomatCodingStandard.TypeHints.LongTypeHints" />
4452

45-
<!-- Don't require a full stop after @throws tags -->
46-
<exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop" />
4753

48-
<!-- Disable some sniffs as they can cause functional changes. These will be enabled later -->
54+
<!-- ************************************************ -->
55+
<!-- Exclude sniffs that may cause functional changes -->
56+
<!-- ************************************************ -->
4957
<exclude name="Generic.PHP.ForbiddenFunctions.FoundWithAlternative" />
50-
<exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements" />
5158
<exclude name="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison" />
5259
<exclude name="SlevomatCodingStandard.ControlStructures.EarlyExit" />
5360
<exclude name="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
5461
<exclude name="SlevomatCodingStandard.Functions.StaticClosure" />
5562
<exclude name="SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure" />
5663
<exclude name="SlevomatCodingStandard.Operators.DisallowEqualOperators" />
5764

58-
<!-- These sniffs cause a large diff, so enable them in separate steps -->
65+
66+
<!-- ********************************************************* -->
67+
<!-- Exclude sniffs that cause a huge diff - enable separately -->
68+
<!-- ********************************************************* -->
5969
<exclude name="SlevomatCodingStandard.Commenting.DocCommentSpacing.IncorrectAnnotationsGroup" />
6070
<exclude name="Squiz.Strings.DoubleQuoteUsage" />
6171

62-
<!-- Sniff currently breaks, see https://github.com/slevomat/coding-standard/issues/727 -->
63-
<exclude name="SlevomatCodingStandard.Namespaces.NamespaceSpacing" />
72+
73+
<!-- ********************* -->
74+
<!-- Exclude broken sniffs -->
75+
<!-- ********************* -->
6476

6577
<!-- Sniff currently broken when casting arrays, see https://github.com/squizlabs/PHP_CodeSniffer/issues/2937#issuecomment-615498860 -->
6678
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline" />
67-
</rule>
6879

69-
<!-- Change use statement sorting to be compatible with PSR-12 -->
70-
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses">
71-
<properties>
72-
<property name="psr12Compatible" value="true"/>
73-
</properties>
80+
<!-- Disable forbidden annotation sniff as excluding @api from the list doesn't work -->
81+
<exclude name="SlevomatCodingStandard.Commenting.ForbiddenAnnotations.AnnotationForbidden" />
7482
</rule>
7583

84+
85+
<!-- ***************************************************** -->
7686
<!-- Forbid fully qualified names even for colliding names -->
87+
<!-- ***************************************************** -->
7788
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
7889
<properties>
7990
<property name="allowFallbackGlobalConstants" value="false"/>
@@ -88,30 +99,91 @@
8899
</properties>
89100
</rule>
90101

91-
<!-- Only enable some checks regarding type hints -->
92-
<!-- In addition to requiring PHP 7.0, this sniff will cause a significant amount of BC breaks. Proceed with caution! -->
93-
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
94-
<!-- Traversable type hints often end up as mixed[], so we skip them for now -->
95-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversablePropertyTypeHintSpecification" />
96-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableParameterTypeHintSpecification" />
97-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingTraversableReturnTypeHintSpecification" />
98102

99-
<!-- Will cause BC breaks to method signatures - disabled for now -->
100-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint" />
101-
<exclude name="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint" />
103+
<!-- **************************************************************************** -->
104+
<!-- Exclude BC breaking type hints for parameters, properties, and return values -->
105+
<!-- **************************************************************************** -->
106+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
107+
<properties>
108+
<!-- Requires PHP 7.4 -->
109+
<property name="enableObjectTypeHint" value="false" />
110+
<!-- Requires PHP 8.0 -->
111+
<property name="enableMixedTypeHint" value="false" />
112+
<!-- Requires PHP 8.0 -->
113+
<property name="enableUnionTypeHint" value="false" />
114+
</properties>
115+
116+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
117+
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.UselessAnnotation" />
118+
</rule>
119+
120+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
121+
<properties>
122+
<!-- Requires PHP 7.4 -->
123+
<property name="enableNativeTypeHint" value="false" />
124+
<!-- Requires PHP 8.0 -->
125+
<property name="enableMixedTypeHint" value="false" />
126+
<!-- Requires PHP 8.0 -->
127+
<property name="enableUnionTypeHint" value="false" />
128+
</properties>
129+
130+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
131+
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.UselessAnnotation" />
132+
</rule>
102133

134+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
103135
<properties>
104-
<property name="enableObjectTypeHint" value="true" />
105-
<property name="enableEachParameterAndReturnInspection" value="false" />
136+
<!-- Requires PHP 7.2 -->
137+
<property name="enableObjectTypeHint" value="false" />
138+
<!-- Requires PHP 8.0 -->
139+
<property name="enableStaticTypeHint" value="false" />
140+
<!-- Requires PHP 8.0 -->
141+
<property name="enableMixedTypeHint" value="false" />
142+
<!-- Requires PHP 8.0 -->
143+
<property name="enableUnionTypeHint" value="false" />
106144
</properties>
145+
146+
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingTraversableTypeHintSpecification" />
147+
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.UselessAnnotation" />
107148
</rule>
108149

150+
151+
<!-- ************************************************************************** -->
152+
<!-- Require type hints for all parameters, properties, and return types in src -->
153+
<!-- ************************************************************************** -->
154+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint">
155+
<exclude-pattern>tests</exclude-pattern>
156+
</rule>
157+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint">
158+
<exclude-pattern>tests</exclude-pattern>
159+
</rule>
160+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint">
161+
<exclude-pattern>tests</exclude-pattern>
162+
</rule>
163+
164+
165+
<!-- *********************************************************************************** -->
166+
<!-- Require native type hints for all parameters, properties, and return types in tests -->
167+
<!-- *********************************************************************************** -->
168+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
169+
<exclude-pattern>src</exclude-pattern>
170+
</rule>
171+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint">
172+
<exclude-pattern>src</exclude-pattern>
173+
</rule>
174+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
175+
<exclude-pattern>src</exclude-pattern>
176+
</rule>
177+
178+
179+
<!-- ************************************************************* -->
180+
<!-- Ignore errors for certain files where this is part of the API -->
181+
<!-- ************************************************************* -->
109182
<rule ref="PSR1.Methods.CamelCapsMethodName.NotCamelCaps">
110183
<exclude-pattern>/src/GridFS/StreamWrapper</exclude-pattern>
111184
<exclude-pattern>/tests/DocumentationExamplesTest.php</exclude-pattern>
112185
<exclude-pattern>/tests/GridFS/UnusableStream.php</exclude-pattern>
113186
</rule>
114-
115187
<rule ref="PSR1.Classes.ClassDeclaration.MultipleClasses">
116188
<exclude-pattern>/tests/PHPUnit/ConstraintTrait.php</exclude-pattern>
117189
</rule>

src/ChangeStream.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use MongoDB\Driver\Exception\ServerException;
2525
use MongoDB\Exception\ResumeTokenException;
2626
use MongoDB\Model\ChangeStreamIterator;
27+
2728
use function call_user_func;
2829
use function in_array;
2930

@@ -40,7 +41,7 @@ class ChangeStream implements Iterator
4041
* @deprecated 1.4
4142
* @todo Remove this in 2.0 (see: PHPLIB-360)
4243
*/
43-
const CURSOR_NOT_FOUND = 43;
44+
public const CURSOR_NOT_FOUND = 43;
4445

4546
/** @var int */
4647
private static $cursorNotFound = 43;

src/Client.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use MongoDB\Operation\ListDatabases;
3939
use MongoDB\Operation\Watch;
4040
use Throwable;
41+
4142
use function is_array;
4243
use function is_string;
4344

@@ -283,7 +284,7 @@ public function getWriteConcern()
283284
* @throws InvalidArgumentException for parameter/option parsing errors
284285
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
285286
*/
286-
public function listDatabaseNames(array $options = []) : Iterator
287+
public function listDatabaseNames(array $options = []): Iterator
287288
{
288289
$operation = new ListDatabaseNames($options);
289290
$server = select_server($this->manager, $options);
@@ -384,7 +385,7 @@ public function watch(array $pipeline = [], array $options = [])
384385
return $operation->execute($server);
385386
}
386387

387-
private static function getVersion() : string
388+
private static function getVersion(): string
388389
{
389390
if (self::$version === null) {
390391
try {
@@ -397,7 +398,7 @@ private static function getVersion() : string
397398
return self::$version;
398399
}
399400

400-
private function mergeDriverInfo(array $driver) : array
401+
private function mergeDriverInfo(array $driver): array
401402
{
402403
$mergedDriver = [
403404
'name' => 'PHPLIB',

src/Collection.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
use MongoDB\Operation\UpdateOne;
5959
use MongoDB\Operation\Watch;
6060
use Traversable;
61+
6162
use function array_diff_key;
6263
use function array_intersect_key;
6364
use function current;
@@ -234,7 +235,8 @@ public function aggregate(array $pipeline, array $options = [])
234235
*
235236
* A read concern is also not compatible with transactions.
236237
*/
237-
if (! isset($options['readConcern']) &&
238+
if (
239+
! isset($options['readConcern']) &&
238240
server_supports_feature($server, self::$wireVersionForReadConcern) &&
239241
! is_in_transaction($options) &&
240242
( ! $hasWriteStage || server_supports_feature($server, self::$wireVersionForReadConcernWithWriteStage))
@@ -246,10 +248,12 @@ public function aggregate(array $pipeline, array $options = [])
246248
$options['typeMap'] = $this->typeMap;
247249
}
248250

249-
if ($hasWriteStage &&
251+
if (
252+
$hasWriteStage &&
250253
! isset($options['writeConcern']) &&
251254
server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern) &&
252-
! is_in_transaction($options)) {
255+
! is_in_transaction($options)
256+
) {
253257
$options['writeConcern'] = $this->writeConcern;
254258
}
255259

src/Command/ListCollections.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use MongoDB\Exception\InvalidArgumentException;
2525
use MongoDB\Model\CachingIterator;
2626
use MongoDB\Operation\Executable;
27+
2728
use function is_array;
2829
use function is_bool;
2930
use function is_integer;

src/Command/ListDatabases.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use MongoDB\Exception\InvalidArgumentException;
2525
use MongoDB\Exception\UnexpectedValueException;
2626
use MongoDB\Operation\Executable;
27+
2728
use function current;
2829
use function is_array;
2930
use function is_bool;

0 commit comments

Comments
 (0)