You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Client.php
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,10 @@
49
49
usefunctionarray_diff_key;
50
50
usefunctionis_array;
51
51
usefunctionis_string;
52
+
usefunctionsprintf;
53
+
usefunctiontrigger_error;
54
+
55
+
useconstE_USER_DEPRECATED;
52
56
53
57
class Client
54
58
{
@@ -228,6 +232,8 @@ public function dropDatabase(string $databaseName, array $options = [])
228
232
{
229
233
if (! isset($options['typeMap'])) {
230
234
$options['typeMap'] = $this->typeMap;
235
+
} else {
236
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
if ($deprecatedFunction !== null && isset($options['typeMap'])) {
1218
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', $deprecatedFunction), E_USER_DEPRECATED);
1219
+
}
1220
+
1217
1221
// Only inherit the type map if no codec is used
1218
1222
if (! isset($options['typeMap']) && ! isset($options['codec'])) {
Copy file name to clipboardExpand all lines: src/Database.php
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,11 @@
55
55
useTraversable;
56
56
57
57
usefunctionis_array;
58
+
usefunctionsprintf;
58
59
usefunctionstrlen;
60
+
usefunctiontrigger_error;
61
+
62
+
useconstE_USER_DEPRECATED;
59
63
60
64
class Database
61
65
{
@@ -286,6 +290,8 @@ public function createCollection(string $collectionName, array $options = [])
286
290
{
287
291
if (! isset($options['typeMap'])) {
288
292
$options['typeMap'] = $this->typeMap;
293
+
} else {
294
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
289
295
}
290
296
291
297
if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
@@ -329,6 +335,8 @@ public function createEncryptedCollection(string $collectionName, ClientEncrypti
329
335
{
330
336
if (! isset($options['typeMap'])) {
331
337
$options['typeMap'] = $this->typeMap;
338
+
} else {
339
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
332
340
}
333
341
334
342
if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
@@ -362,6 +370,8 @@ public function drop(array $options = [])
362
370
{
363
371
if (! isset($options['typeMap'])) {
364
372
$options['typeMap'] = $this->typeMap;
373
+
} else {
374
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
@@ -390,6 +400,8 @@ public function dropCollection(string $collectionName, array $options = [])
390
400
{
391
401
if (! isset($options['typeMap'])) {
392
402
$options['typeMap'] = $this->typeMap;
403
+
} else {
404
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
0 commit comments