@@ -93,7 +93,7 @@ public function __toString()
93
93
* @param array $options Command options
94
94
* @return Traversable
95
95
*/
96
- public function aggregate (array $ pipeline , array $ options = array () )
96
+ public function aggregate (array $ pipeline , array $ options = [] )
97
97
{
98
98
if ( ! isset ($ options ['readPreference ' ])) {
99
99
$ options ['readPreference ' ] = $ this ->readPreference ;
@@ -117,7 +117,7 @@ public function aggregate(array $pipeline, array $options = array())
117
117
* @param array $options Command options
118
118
* @return BulkWriteResult
119
119
*/
120
- public function bulkWrite (array $ operations , array $ options = array () )
120
+ public function bulkWrite (array $ operations , array $ options = [] )
121
121
{
122
122
if ( ! isset ($ options ['writeConcern ' ])) {
123
123
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -137,7 +137,7 @@ public function bulkWrite(array $operations, array $options = array())
137
137
* @param array $options Command options
138
138
* @return integer
139
139
*/
140
- public function count ($ filter = array () , array $ options = array () )
140
+ public function count ($ filter = [] , array $ options = [] )
141
141
{
142
142
if ( ! isset ($ options ['readPreference ' ])) {
143
143
$ options ['readPreference ' ] = $ this ->readPreference ;
@@ -158,9 +158,9 @@ public function count($filter = array(), array $options = array())
158
158
* @param array $options Index options
159
159
* @return string The name of the created index
160
160
*/
161
- public function createIndex ($ key , array $ options = array () )
161
+ public function createIndex ($ key , array $ options = [] )
162
162
{
163
- return current ($ this ->createIndexes (array ( array ( 'key ' => $ key) + $ options) ));
163
+ return current ($ this ->createIndexes ([[ 'key ' => $ key] + $ options] ));
164
164
}
165
165
166
166
/**
@@ -203,7 +203,7 @@ public function createIndexes(array $indexes)
203
203
* @param array $options Command options
204
204
* @return DeleteResult
205
205
*/
206
- public function deleteMany ($ filter , array $ options = array () )
206
+ public function deleteMany ($ filter , array $ options = [] )
207
207
{
208
208
if ( ! isset ($ options ['writeConcern ' ])) {
209
209
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -224,7 +224,7 @@ public function deleteMany($filter, array $options = array())
224
224
* @param array $options Command options
225
225
* @return DeleteResult
226
226
*/
227
- public function deleteOne ($ filter , array $ options = array () )
227
+ public function deleteOne ($ filter , array $ options = [] )
228
228
{
229
229
if ( ! isset ($ options ['writeConcern ' ])) {
230
230
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -245,7 +245,7 @@ public function deleteOne($filter, array $options = array())
245
245
* @param array $options Command options
246
246
* @return mixed[]
247
247
*/
248
- public function distinct ($ fieldName , $ filter = array () , array $ options = array () )
248
+ public function distinct ($ fieldName , $ filter = [] , array $ options = [] )
249
249
{
250
250
if ( ! isset ($ options ['readPreference ' ])) {
251
251
$ options ['readPreference ' ] = $ this ->readPreference ;
@@ -313,7 +313,7 @@ public function dropIndexes()
313
313
* @param array $options Additional options
314
314
* @return Cursor
315
315
*/
316
- public function find ($ filter = array () , array $ options = array () )
316
+ public function find ($ filter = [] , array $ options = [] )
317
317
{
318
318
if ( ! isset ($ options ['readPreference ' ])) {
319
319
$ options ['readPreference ' ] = $ this ->readPreference ;
@@ -334,7 +334,7 @@ public function find($filter = array(), array $options = array())
334
334
* @param array $options Additional options
335
335
* @return object|null
336
336
*/
337
- public function findOne ($ filter = array () , array $ options = array () )
337
+ public function findOne ($ filter = [] , array $ options = [] )
338
338
{
339
339
if ( ! isset ($ options ['readPreference ' ])) {
340
340
$ options ['readPreference ' ] = $ this ->readPreference ;
@@ -357,7 +357,7 @@ public function findOne($filter = array(), array $options = array())
357
357
* @param array $options Command options
358
358
* @return object|null
359
359
*/
360
- public function findOneAndDelete ($ filter , array $ options = array () )
360
+ public function findOneAndDelete ($ filter , array $ options = [] )
361
361
{
362
362
$ operation = new FindOneAndDelete ($ this ->databaseName , $ this ->collectionName , $ filter , $ options );
363
363
$ server = $ this ->manager ->selectServer (new ReadPreference (ReadPreference::RP_PRIMARY ));
@@ -380,7 +380,7 @@ public function findOneAndDelete($filter, array $options = array())
380
380
* @param array $options Command options
381
381
* @return object|null
382
382
*/
383
- public function findOneAndReplace ($ filter , $ replacement , array $ options = array () )
383
+ public function findOneAndReplace ($ filter , $ replacement , array $ options = [] )
384
384
{
385
385
$ operation = new FindOneAndReplace ($ this ->databaseName , $ this ->collectionName , $ filter , $ replacement , $ options );
386
386
$ server = $ this ->manager ->selectServer (new ReadPreference (ReadPreference::RP_PRIMARY ));
@@ -403,7 +403,7 @@ public function findOneAndReplace($filter, $replacement, array $options = array(
403
403
* @param array $options Command options
404
404
* @return object|null
405
405
*/
406
- public function findOneAndUpdate ($ filter , $ update , array $ options = array () )
406
+ public function findOneAndUpdate ($ filter , $ update , array $ options = [] )
407
407
{
408
408
$ operation = new FindOneAndUpdate ($ this ->databaseName , $ this ->collectionName , $ filter , $ update , $ options );
409
409
$ server = $ this ->manager ->selectServer (new ReadPreference (ReadPreference::RP_PRIMARY ));
@@ -451,7 +451,7 @@ public function getNamespace()
451
451
* @param array $options Command options
452
452
* @return InsertManyResult
453
453
*/
454
- public function insertMany (array $ documents , array $ options = array () )
454
+ public function insertMany (array $ documents , array $ options = [] )
455
455
{
456
456
if ( ! isset ($ options ['writeConcern ' ])) {
457
457
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -472,7 +472,7 @@ public function insertMany(array $documents, array $options = array())
472
472
* @param array $options Command options
473
473
* @return InsertOneResult
474
474
*/
475
- public function insertOne ($ document , array $ options = array () )
475
+ public function insertOne ($ document , array $ options = [] )
476
476
{
477
477
if ( ! isset ($ options ['writeConcern ' ])) {
478
478
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -490,7 +490,7 @@ public function insertOne($document, array $options = array())
490
490
* @see ListIndexes::__construct() for supported options
491
491
* @return IndexInfoIterator
492
492
*/
493
- public function listIndexes (array $ options = array () )
493
+ public function listIndexes (array $ options = [] )
494
494
{
495
495
$ operation = new ListIndexes ($ this ->databaseName , $ this ->collectionName , $ options );
496
496
$ server = $ this ->manager ->selectServer (new ReadPreference (ReadPreference::RP_PRIMARY ));
@@ -508,7 +508,7 @@ public function listIndexes(array $options = array())
508
508
* @param array $options Command options
509
509
* @return UpdateResult
510
510
*/
511
- public function replaceOne ($ filter , $ replacement , array $ options = array () )
511
+ public function replaceOne ($ filter , $ replacement , array $ options = [] )
512
512
{
513
513
if ( ! isset ($ options ['writeConcern ' ])) {
514
514
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -530,7 +530,7 @@ public function replaceOne($filter, $replacement, array $options = array())
530
530
* @param array $options Command options
531
531
* @return UpdateResult
532
532
*/
533
- public function updateMany ($ filter , $ update , array $ options = array () )
533
+ public function updateMany ($ filter , $ update , array $ options = [] )
534
534
{
535
535
if ( ! isset ($ options ['writeConcern ' ])) {
536
536
$ options ['writeConcern ' ] = $ this ->writeConcern ;
@@ -552,7 +552,7 @@ public function updateMany($filter, $update, array $options = array())
552
552
* @param array $options Command options
553
553
* @return UpdateResult
554
554
*/
555
- public function updateOne ($ filter , $ update , array $ options = array () )
555
+ public function updateOne ($ filter , $ update , array $ options = [] )
556
556
{
557
557
if ( ! isset ($ options ['writeConcern ' ])) {
558
558
$ options ['writeConcern ' ] = $ this ->writeConcern ;
0 commit comments