From b252443a2b6df720f5acbfa42cb3f2b39dc84296 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 24 Jul 2023 09:21:36 +0200 Subject: [PATCH 1/2] PHPLIB-1208: Use separate namespaces for examples (#1139) --- examples/aggregate.php | 2 +- examples/bulk.php | 2 +- examples/changestream.php | 2 +- examples/command_logger.php | 2 +- examples/persistable.php | 2 +- examples/typemap.php | 2 +- examples/with_transaction.php | 2 +- tests/ExamplesTest.php | 28 ++++++++++++++-------------- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/aggregate.php b/examples/aggregate.php index d1ee69450..58ce7eb9e 100644 --- a/examples/aggregate.php +++ b/examples/aggregate.php @@ -1,7 +1,7 @@ MongoDB\BSON\ObjectId Object + [id:MongoDB\Examples\Persistable\PersistableEntry:private] => MongoDB\BSON\ObjectId Object ( [oid] => %s ) @@ -100,13 +100,13 @@ public function dataExamples(): Generator [name] => alcaeus [emails] => Array ( - [0] => MongoDB\Examples\PersistableEmail Object + [0] => MongoDB\Examples\Persistable\PersistableEmail Object ( [type] => work [address] => alcaeus@example.com ) - [1] => MongoDB\Examples\PersistableEmail Object + [1] => MongoDB\Examples\Persistable\PersistableEmail Object ( [type] => private [address] => secret@example.com @@ -123,26 +123,26 @@ public function dataExamples(): 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] => alcaeus@example.com + [type:MongoDB\Examples\Typemap\TypeMapEmail:private] => work + [address:MongoDB\Examples\Typemap\TypeMapEmail:private] => alcaeus@example.com ) - [1] => MongoDB\Examples\TypeMapEmail Object + [1] => MongoDB\Examples\Typemap\TypeMapEmail Object ( - [type:MongoDB\Examples\TypeMapEmail:private] => private - [address:MongoDB\Examples\TypeMapEmail:private] => secret@example.com + [type:MongoDB\Examples\Typemap\TypeMapEmail:private] => private + [address:MongoDB\Examples\Typemap\TypeMapEmail:private] => secret@example.com ) ) From 72d80889eb7567c0da4e7d4ddbdcf66dfea90ac3 Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 26 Sep 2023 11:44:10 -0400 Subject: [PATCH 2/2] PHPLIB-1137: Mark is_document() as internal (#1176) This was missed in 88731a55c3dfd97b38ce0360f53b5b2674209754 --- src/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/functions.php b/src/functions.php index 4acec021c..0a9b882ec 100644 --- a/src/functions.php +++ b/src/functions.php @@ -192,6 +192,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