Skip to content

Commit b252443

Browse files
authored
PHPLIB-1208: Use separate namespaces for examples (#1139)
1 parent 88731a5 commit b252443

8 files changed

+21
-21
lines changed

examples/aggregate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\Aggregate;
55

66
use MongoDB\Client;
77

examples/bulk.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\Bulk;
55

66
use MongoDB\Client;
77
use MongoDB\Driver\WriteConcern;

examples/changestream.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\ChangeStream;
55

66
use MongoDB\Client;
77

examples/command_logger.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\CommandLogger;
55

66
use MongoDB\Client;
77
use MongoDB\Driver\Monitoring\CommandFailedEvent;

examples/persistable.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\Persistable;
55

66
use MongoDB\BSON\ObjectId;
77
use MongoDB\BSON\Persistable;

examples/typemap.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\Typemap;
55

66
use MongoDB\BSON\ObjectId;
77
use MongoDB\BSON\Unserializable;

examples/with_transaction.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace MongoDB\Examples;
4+
namespace MongoDB\Examples\WithTransaction;
55

66
use MongoDB\Client;
77
use MongoDB\Driver\Session;

tests/ExamplesTest.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -90,23 +90,23 @@ public function dataExamples(): Generator
9090
];
9191

9292
$expectedOutput = <<<'OUTPUT'
93-
MongoDB\Examples\PersistableEntry Object
93+
MongoDB\Examples\Persistable\PersistableEntry Object
9494
(
95-
[id:MongoDB\Examples\PersistableEntry:private] => MongoDB\BSON\ObjectId Object
95+
[id:MongoDB\Examples\Persistable\PersistableEntry:private] => MongoDB\BSON\ObjectId Object
9696
(
9797
[oid] => %s
9898
)
9999
100100
[name] => alcaeus
101101
[emails] => Array
102102
(
103-
[0] => MongoDB\Examples\PersistableEmail Object
103+
[0] => MongoDB\Examples\Persistable\PersistableEmail Object
104104
(
105105
[type] => work
106106
[address] => [email protected]
107107
)
108108
109-
[1] => MongoDB\Examples\PersistableEmail Object
109+
[1] => MongoDB\Examples\Persistable\PersistableEmail Object
110110
(
111111
[type] => private
112112
[address] => [email protected]
@@ -123,26 +123,26 @@ public function dataExamples(): Generator
123123
];
124124

125125
$expectedOutput = <<<'OUTPUT'
126-
MongoDB\Examples\TypeMapEntry Object
126+
MongoDB\Examples\Typemap\TypeMapEntry Object
127127
(
128-
[id:MongoDB\Examples\TypeMapEntry:private] => MongoDB\BSON\ObjectId Object
128+
[id:MongoDB\Examples\Typemap\TypeMapEntry:private] => MongoDB\BSON\ObjectId Object
129129
(
130130
[oid] => %s
131131
)
132132
133-
[name:MongoDB\Examples\TypeMapEntry:private] => alcaeus
134-
[emails:MongoDB\Examples\TypeMapEntry:private] => Array
133+
[name:MongoDB\Examples\Typemap\TypeMapEntry:private] => alcaeus
134+
[emails:MongoDB\Examples\Typemap\TypeMapEntry:private] => Array
135135
(
136-
[0] => MongoDB\Examples\TypeMapEmail Object
136+
[0] => MongoDB\Examples\Typemap\TypeMapEmail Object
137137
(
138-
[type:MongoDB\Examples\TypeMapEmail:private] => work
139-
[address:MongoDB\Examples\TypeMapEmail:private] => [email protected]
138+
[type:MongoDB\Examples\Typemap\TypeMapEmail:private] => work
139+
[address:MongoDB\Examples\Typemap\TypeMapEmail:private] => [email protected]
140140
)
141141
142-
[1] => MongoDB\Examples\TypeMapEmail Object
142+
[1] => MongoDB\Examples\Typemap\TypeMapEmail Object
143143
(
144-
[type:MongoDB\Examples\TypeMapEmail:private] => private
145-
[address:MongoDB\Examples\TypeMapEmail:private] => [email protected]
144+
[type:MongoDB\Examples\Typemap\TypeMapEmail:private] => private
145+
[address:MongoDB\Examples\Typemap\TypeMapEmail:private] => [email protected]
146146
)
147147
148148
)

0 commit comments

Comments
 (0)