Skip to content

Commit

Permalink
Merge branch 'v1.16'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikola committed Sep 26, 2023
2 parents 510f812 + 72d8088 commit 74d19f8
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/aggregate.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\Aggregate;

use MongoDB\Client;

Expand Down
2 changes: 1 addition & 1 deletion examples/bulk.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\Bulk;

use MongoDB\Client;
use MongoDB\Driver\WriteConcern;
Expand Down
2 changes: 1 addition & 1 deletion examples/changestream.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\ChangeStream;

use MongoDB\Client;

Expand Down
2 changes: 1 addition & 1 deletion examples/command_logger.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\CommandLogger;

use MongoDB\Client;
use MongoDB\Driver\Monitoring\CommandFailedEvent;
Expand Down
2 changes: 1 addition & 1 deletion examples/persistable.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\Persistable;

use MongoDB\BSON\ObjectId;
use MongoDB\BSON\Persistable;
Expand Down
2 changes: 1 addition & 1 deletion examples/typemap.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\Typemap;

use MongoDB\BSON\ObjectId;
use MongoDB\BSON\Unserializable;
Expand Down
2 changes: 1 addition & 1 deletion examples/with_transaction.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
declare(strict_types=1);

namespace MongoDB\Examples;
namespace MongoDB\Examples\WithTransaction;

use MongoDB\Client;
use MongoDB\Driver\Session;
Expand Down
1 change: 1 addition & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function get_encrypted_fields_from_server(string $databaseName, string $collecti
* This method returns true for any array or object, but specifically excludes
* BSON PackedArray instances
*
* @internal
* @param mixed $document
*/
function is_document($document): bool
Expand Down
28 changes: 14 additions & 14 deletions tests/ExamplesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,23 @@ public static function provideExamples(): Generator
];

$expectedOutput = <<<'OUTPUT'
MongoDB\Examples\PersistableEntry Object
MongoDB\Examples\Persistable\PersistableEntry Object
(
[id:MongoDB\Examples\PersistableEntry:private] => MongoDB\BSON\ObjectId Object
[id:MongoDB\Examples\Persistable\PersistableEntry:private] => MongoDB\BSON\ObjectId Object
(
[oid] => %s
)
[name] => alcaeus
[emails] => Array
(
[0] => MongoDB\Examples\PersistableEmail Object
[0] => MongoDB\Examples\Persistable\PersistableEmail Object
(
[type] => work
[address] => [email protected]
)
[1] => MongoDB\Examples\PersistableEmail Object
[1] => MongoDB\Examples\Persistable\PersistableEmail Object
(
[type] => private
[address] => [email protected]
Expand Down Expand Up @@ -150,26 +150,26 @@ public static function provideExamples(): Generator
];

$expectedOutput = <<<'OUTPUT'
MongoDB\Examples\TypeMapEntry Object
MongoDB\Examples\Typemap\TypeMapEntry Object
(
[id:MongoDB\Examples\TypeMapEntry:private] => MongoDB\BSON\ObjectId Object
[id:MongoDB\Examples\Typemap\TypeMapEntry:private] => MongoDB\BSON\ObjectId Object
(
[oid] => %s
)
[name:MongoDB\Examples\TypeMapEntry:private] => alcaeus
[emails:MongoDB\Examples\TypeMapEntry:private] => Array
[name:MongoDB\Examples\Typemap\TypeMapEntry:private] => alcaeus
[emails:MongoDB\Examples\Typemap\TypeMapEntry:private] => Array
(
[0] => MongoDB\Examples\TypeMapEmail Object
[0] => MongoDB\Examples\Typemap\TypeMapEmail Object
(
[type:MongoDB\Examples\TypeMapEmail:private] => work
[address:MongoDB\Examples\TypeMapEmail:private] => [email protected]
[type:MongoDB\Examples\Typemap\TypeMapEmail:private] => work
[address:MongoDB\Examples\Typemap\TypeMapEmail:private] => [email protected]
)
[1] => MongoDB\Examples\TypeMapEmail Object
[1] => MongoDB\Examples\Typemap\TypeMapEmail Object
(
[type:MongoDB\Examples\TypeMapEmail:private] => private
[address:MongoDB\Examples\TypeMapEmail:private] => [email protected]
[type:MongoDB\Examples\Typemap\TypeMapEmail:private] => private
[address:MongoDB\Examples\Typemap\TypeMapEmail:private] => [email protected]
)
)
Expand Down

0 comments on commit 74d19f8

Please sign in to comment.