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
+6
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,10 @@
50
50
usefunctionarray_diff_key;
51
51
usefunctionis_array;
52
52
usefunctionis_string;
53
+
usefunctionsprintf;
54
+
usefunctiontrigger_error;
55
+
56
+
useconstE_USER_DEPRECATED;
53
57
54
58
class Client
55
59
{
@@ -223,6 +227,8 @@ public function dropDatabase(string $databaseName, array $options = []): array|o
223
227
{
224
228
if (! isset($options['typeMap'])) {
225
229
$options['typeMap'] = $this->typeMap;
230
+
} else {
231
+
@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'])) {
1182
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', $deprecatedFunction), E_USER_DEPRECATED);
1183
+
}
1184
+
1181
1185
// Only inherit the type map if no codec is used
1182
1186
if (! isset($options['typeMap']) && ! isset($options['codec'])) {
Copy file name to clipboardExpand all lines: src/Database.php
+12
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,11 @@
55
55
useThrowable;
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
{
@@ -280,6 +284,8 @@ public function createCollection(string $collectionName, array $options = []): a
280
284
{
281
285
if (! isset($options['typeMap'])) {
282
286
$options['typeMap'] = $this->typeMap;
287
+
} else {
288
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
283
289
}
284
290
285
291
if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
@@ -323,6 +329,8 @@ public function createEncryptedCollection(string $collectionName, ClientEncrypti
323
329
{
324
330
if (! isset($options['typeMap'])) {
325
331
$options['typeMap'] = $this->typeMap;
332
+
} else {
333
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
326
334
}
327
335
328
336
if (! isset($options['writeConcern']) && ! is_in_transaction($options)) {
@@ -356,6 +364,8 @@ public function drop(array $options = []): array|object
356
364
{
357
365
if (! isset($options['typeMap'])) {
358
366
$options['typeMap'] = $this->typeMap;
367
+
} else {
368
+
@trigger_error(sprintf('The function %s() will return nothing in mongodb/mongodb v2.0, the "typeMap" option is deprecated', __FUNCTION__), E_USER_DEPRECATED);
@@ -384,6 +394,8 @@ public function dropCollection(string $collectionName, array $options = []): arr
384
394
{
385
395
if (! isset($options['typeMap'])) {
386
396
$options['typeMap'] = $this->typeMap;
397
+
} else {
398
+
@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