@@ -163,7 +163,7 @@ public function bulkWrite(array $bulk, array $options = array())
163163 foreach ($ bulk as $ n => $ op ) {
164164 foreach ($ op as $ opname => $ args ) {
165165 if (!isset ($ args [0 ])) {
166- throw new \ InvalidArgumentException (sprintf ("Missing argument#1 for '%s' (operation#%d) " , $ opname , $ n ));
166+ throw new InvalidArgumentException (sprintf ("Missing argument#1 for '%s' (operation#%d) " , $ opname , $ n ));
167167 }
168168
169169 switch ($ opname ) {
@@ -173,7 +173,7 @@ public function bulkWrite(array $bulk, array $options = array())
173173
174174 case "updateMany " :
175175 if (!isset ($ args [1 ])) {
176- throw new \ InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
176+ throw new InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
177177 }
178178 $ options = array_merge ($ this ->getWriteOptions (), isset ($ args [2 ]) ? $ args [2 ] : array (), array ("limit " => 0 ));
179179
@@ -182,25 +182,25 @@ public function bulkWrite(array $bulk, array $options = array())
182182
183183 case "updateOne " :
184184 if (!isset ($ args [1 ])) {
185- throw new \ InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
185+ throw new InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
186186 }
187187 $ options = array_merge ($ this ->getWriteOptions (), isset ($ args [2 ]) ? $ args [2 ] : array (), array ("limit " => 1 ));
188188 $ firstKey = key ($ args [1 ]);
189189 if (!isset ($ firstKey [0 ]) || $ firstKey [0 ] != '$ ' ) {
190- throw new \ InvalidArgumentException ("First key in \$update must be a \$operator " );
190+ throw new InvalidArgumentException ("First key in \$update must be a \$operator " );
191191 }
192192
193193 $ bulk ->update ($ args [0 ], $ args [1 ], $ options );
194194 break ;
195195
196196 case "replaceOne " :
197197 if (!isset ($ args [1 ])) {
198- throw new \ InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
198+ throw new InvalidArgumentException (sprintf ("Missing argument#2 for '%s' (operation#%d) " , $ opname , $ n ));
199199 }
200200 $ options = array_merge ($ this ->getWriteOptions (), isset ($ args [2 ]) ? $ args [2 ] : array (), array ("limit " => 1 ));
201201 $ firstKey = key ($ args [1 ]);
202202 if (isset ($ firstKey [0 ]) && $ firstKey [0 ] == '$ ' ) {
203- throw new \ InvalidArgumentException ("First key in \$update must NOT be a \$operator " );
203+ throw new InvalidArgumentException ("First key in \$update must NOT be a \$operator " );
204204 }
205205
206206 $ bulk ->update ($ args [0 ], $ args [1 ], $ options );
@@ -217,7 +217,7 @@ public function bulkWrite(array $bulk, array $options = array())
217217 break ;
218218
219219 default :
220- throw new \ InvalidArgumentException (sprintf ("Unknown operation type called '%s' (operation#%d) " , $ opname , $ n ));
220+ throw new InvalidArgumentException (sprintf ("Unknown operation type called '%s' (operation#%d) " , $ opname , $ n ));
221221 }
222222 }
223223 }
@@ -521,7 +521,7 @@ public function findOneAndReplace(array $filter, array $replacement, array $opti
521521 {
522522 $ firstKey = key ($ replacement );
523523 if (isset ($ firstKey [0 ]) && $ firstKey [0 ] == '$ ' ) {
524- throw new \ InvalidArgumentException ("First key in \$replacement must NOT be a \$operator " );
524+ throw new InvalidArgumentException ("First key in \$replacement must NOT be a \$operator " );
525525 }
526526
527527 $ options = array_merge ($ this ->getFindOneAndReplaceOptions (), $ options );
@@ -559,7 +559,7 @@ public function findOneAndUpdate(array $filter, array $update, array $options =
559559 {
560560 $ firstKey = key ($ update );
561561 if (!isset ($ firstKey [0 ]) || $ firstKey [0 ] != '$ ' ) {
562- throw new \ InvalidArgumentException ("First key in \$update must be a \$operator " );
562+ throw new InvalidArgumentException ("First key in \$update must be a \$operator " );
563563 }
564564
565565 $ options = array_merge ($ this ->getFindOneAndUpdateOptions (), $ options );
@@ -1036,7 +1036,7 @@ public function replaceOne(array $filter, array $update, array $options = array(
10361036 {
10371037 $ firstKey = key ($ update );
10381038 if (isset ($ firstKey [0 ]) && $ firstKey [0 ] == '$ ' ) {
1039- throw new \ InvalidArgumentException ("First key in \$update must NOT be a \$operator " );
1039+ throw new InvalidArgumentException ("First key in \$update must NOT be a \$operator " );
10401040 }
10411041 $ wr = $ this ->_update ($ filter , $ update , $ options );
10421042
@@ -1078,7 +1078,7 @@ public function updateOne(array $filter, array $update, array $options = array()
10781078 {
10791079 $ firstKey = key ($ update );
10801080 if (!isset ($ firstKey [0 ]) || $ firstKey [0 ] != '$ ' ) {
1081- throw new \ InvalidArgumentException ("First key in \$update must be a \$operator " );
1081+ throw new InvalidArgumentException ("First key in \$update must be a \$operator " );
10821082 }
10831083 $ wr = $ this ->_update ($ filter , $ update , $ options );
10841084
@@ -1134,10 +1134,10 @@ final protected function _delete($filter, $limit = 1)
11341134 final protected function _generateCommandException ($ doc )
11351135 {
11361136 if ($ doc ["errmsg " ]) {
1137- return new Exception ($ doc ["errmsg " ]);
1137+ return new RuntimeException ($ doc ["errmsg " ]);
11381138 }
11391139 var_dump ($ doc );
1140- return new \ Exception ("FIXME: Unknown error " );
1140+ return new RuntimeException ("FIXME: Unknown error " );
11411141 }
11421142
11431143 /**
0 commit comments