Skip to content

Commit 4dc36f6

Browse files
committed
Merge pull request #399
2 parents de1f5fb + 236657b commit 4dc36f6

31 files changed

+451
-10
lines changed

.travis.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ sudo: false
55
services:
66
- mongodb
77

8-
env:
9-
global:
10-
- DRIVER_VERSION=stable SERVER_VERSION=3.4
11-
128
addons:
139
apt:
1410
packages: &common_packages
@@ -18,7 +14,7 @@ matrix:
1814
fast_finish: true
1915
include:
2016
- php: 5.5
21-
env: &common_env DRIVER_VERSION=stable SERVER_VERSION=3.4
17+
env: &common_env DRIVER_VERSION=1.3.0RC1 SERVER_VERSION=3.4
2218
addons: &common_addons
2319
apt:
2420
sources: [ mongodb-3.4-precise ]
@@ -36,25 +32,25 @@ matrix:
3632
env: *common_env
3733
addons: *common_addons
3834
- php: 7.0
39-
env: DRIVER_VERSION=1.2.0 SERVER_VERSION=2.4
35+
env: DRIVER_VERSION=1.3.0RC1 SERVER_VERSION=2.4
4036
addons:
4137
apt:
4238
sources: [ mongodb-upstart ]
4339
packages: [ mongodb-10gen, *common_packages ]
4440
- php: 7.0
45-
env: DRIVER_VERSION=1.2.0 SERVER_VERSION=2.6
41+
env: DRIVER_VERSION=1.3.0RC1 SERVER_VERSION=2.6
4642
addons:
4743
apt:
4844
sources: [ mongodb-upstart ]
4945
packages: [ mongodb-org, *common_packages ]
5046
- php: 7.0
51-
env: DRIVER_VERSION=1.2.0 SERVER_VERSION=3.0
47+
env: DRIVER_VERSION=1.3.0RC1 SERVER_VERSION=3.0
5248
addons:
5349
apt:
5450
sources: [ mongodb-3.0-precise ]
5551
packages: [ mongodb-org, *common_packages ]
5652
- php: 7.0
57-
env: DRIVER_VERSION=1.2.0 SERVER_VERSION=3.2
53+
env: DRIVER_VERSION=1.3.0RC1 SERVER_VERSION=3.2
5854
addons:
5955
apt:
6056
sources: [ mongodb-3.2-precise ]

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=5.4",
14-
"ext-mongodb": "^1.2.0"
14+
"ext-mongodb": "^1.3.0"
1515
},
1616
"require-dev": {
1717
"phpunit/phpunit": "^4.8"

src/Operation/Aggregate.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ public function __construct($databaseName, $collectionName, array $pipeline, arr
182182
throw new InvalidArgumentException('"typeMap" option should not be used if "useCursor" is false');
183183
}
184184

185+
if (isset($options['readConcern']) && $options['readConcern']->isDefault()) {
186+
unset($options['readConcern']);
187+
}
188+
189+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
190+
unset($options['writeConcern']);
191+
}
192+
185193
$this->databaseName = (string) $databaseName;
186194
$this->collectionName = (string) $collectionName;
187195
$this->pipeline = $pipeline;

src/Operation/BulkWrite.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ public function __construct($databaseName, $collectionName, array $operations, a
266266
throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern');
267267
}
268268

269+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
270+
unset($options['writeConcern']);
271+
}
272+
269273
$this->databaseName = (string) $databaseName;
270274
$this->collectionName = (string) $collectionName;
271275
$this->operations = $operations;

src/Operation/Count.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ public function __construct($databaseName, $collectionName, $filter = [], array
117117
throw InvalidArgumentException::invalidType('"skip" option', $options['skip'], 'integer');
118118
}
119119

120+
if (isset($options['readConcern']) && $options['readConcern']->isDefault()) {
121+
unset($options['readConcern']);
122+
}
123+
120124
$this->databaseName = (string) $databaseName;
121125
$this->collectionName = (string) $collectionName;
122126
$this->filter = $filter;

src/Operation/CreateCollection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ public function __construct($databaseName, $collectionName, array $options = [])
157157
throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern');
158158
}
159159

160+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
161+
unset($options['writeConcern']);
162+
}
163+
160164
$this->databaseName = (string) $databaseName;
161165
$this->collectionName = (string) $collectionName;
162166
$this->options = $options;

src/Operation/CreateIndexes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ public function __construct($databaseName, $collectionName, array $indexes, arra
9696
throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern');
9797
}
9898

99+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
100+
unset($options['writeConcern']);
101+
}
102+
99103
$this->databaseName = (string) $databaseName;
100104
$this->collectionName = (string) $collectionName;
101105
$this->options = $options;

src/Operation/Delete.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public function __construct($databaseName, $collectionName, $filter, $limit, arr
8383
throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern');
8484
}
8585

86+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
87+
unset($options['writeConcern']);
88+
}
89+
8690
$this->databaseName = (string) $databaseName;
8791
$this->collectionName = (string) $collectionName;
8892
$this->filter = $filter;

src/Operation/Distinct.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public function __construct($databaseName, $collectionName, $fieldName, $filter
9393
throw InvalidArgumentException::invalidType('"readPreference" option', $options['readPreference'], 'MongoDB\Driver\ReadPreference');
9494
}
9595

96+
if (isset($options['readConcern']) && $options['readConcern']->isDefault()) {
97+
unset($options['readConcern']);
98+
}
99+
96100
$this->databaseName = (string) $databaseName;
97101
$this->collectionName = (string) $collectionName;
98102
$this->fieldName = (string) $fieldName;

src/Operation/DropCollection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public function __construct($databaseName, $collectionName, array $options = [])
6969
throw InvalidArgumentException::invalidType('"writeConcern" option', $options['writeConcern'], 'MongoDB\Driver\WriteConcern');
7070
}
7171

72+
if (isset($options['writeConcern']) && $options['writeConcern']->isDefault()) {
73+
unset($options['writeConcern']);
74+
}
75+
7276
$this->databaseName = (string) $databaseName;
7377
$this->collectionName = (string) $collectionName;
7478
$this->options = $options;

0 commit comments

Comments
 (0)