Skip to content

Commit e5411c1

Browse files
authored
PHPLIB-1046: Fix snooty errors in documentation (#1010)
* Remove literal code blocks * Fix minor errors in documentation * Add missing code-block directives * Fix more docs errors * Fix wrong backticks style
1 parent 8b82bda commit e5411c1

File tree

113 files changed

+446
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+446
-183
lines changed

source/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ description: |
143143
collection.
144144
145145
The ``indexOptionDefaults`` option accepts a ``storageEngine`` document,
146-
which should take the following form::
146+
which should take the following form:
147147
148+
.. code-block:: none
149+
148150
{ <storage-engine-name>: <options> }
149151
150152
Storage engine configurations specified when creating indexes are validated
@@ -212,8 +214,10 @@ description: |
212214
213215
Allows users to specify configuration to the storage engine on a
214216
per-collection basis when creating a collection. The value of the
215-
``storageEngine`` option should take the following form::
217+
``storageEngine`` option should take the following form:
216218
219+
.. code-block:: none
220+
217221
{ <storage-engine-name>: <options> }
218222
219223
Storage engine configurations specified when creating collections are

source/reference/class/MongoDBCollection.txt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Definition
2323
select a collection from the library's :phpclass:`MongoDB\\Client` or
2424
:phpclass:`MongoDB\\Database` classes. A collection may also be cloned from
2525
an existing :phpclass:`MongoDB\\Collection` object via the
26-
:phpmethod:`withOptions() <MongoDB\\Collection::withOptions>` method.
26+
:phpmethod:`withOptions() <MongoDB\\Collection::withOptions()>` method.
2727

2828
:phpclass:`MongoDB\\Collection` supports the :php:`readConcern
2929
<mongodb-driver-readconcern>`, :php:`readPreference
@@ -41,17 +41,16 @@ Definition
4141
Type Map Limitations
4242
--------------------
4343

44-
The :manual:`aggregate </reference/command/aggregate>` (when not using a
45-
cursor), :manual:`distinct </reference/command/distinct>`, and
46-
:manual:`findAndModify </reference/command/findAndModify>` helpers do not
47-
support a ``typeMap`` option due to a driver limitation. The
48-
:phpmethod:`aggregate() <MongoDB\\Collection::aggregate>`,
49-
:phpmethod:`distinct() <MongoDB\\Collection::distinct>`,
50-
:phpmethod:`findOneAndReplace() <MongoDB\\Collection::findOneAndReplace>`,
51-
:phpmethod:`findOneAndUpdate() <MongoDB\\Collection::findOneAndUpdate>`, and
52-
:phpmethod:`findOneAndDelete() <MongoDB\\Collection::findOneAndDelete>`
53-
methods return BSON documents as `stdClass` objects and BSON arrays as
54-
arrays.
44+
The :manual:`aggregate </reference/command/aggregate>` (when not using a
45+
cursor), :manual:`distinct </reference/command/distinct>`, and
46+
:manual:`findAndModify </reference/command/findAndModify>` helpers do not
47+
support a ``typeMap`` option due to a driver limitation. The
48+
:phpmethod:`aggregate() <MongoDB\\Collection::aggregate()>`,
49+
:phpmethod:`distinct() <MongoDB\\Collection::distinct()>`,
50+
:phpmethod:`findOneAndReplace() <MongoDB\\Collection::findOneAndReplace()>`,
51+
:phpmethod:`findOneAndUpdate() <MongoDB\\Collection::findOneAndUpdate()>`, and
52+
:phpmethod:`findOneAndDelete() <MongoDB\\Collection::findOneAndDelete()>`
53+
methods return BSON documents as ``stdClass`` objects and BSON arrays as arrays.
5554

5655
Methods
5756
-------

source/reference/class/MongoDBDatabase.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Definition
2222
:php:`MongoDB\\Driver\\Manager <class.mongodb-driver-manager>` class or
2323
select a database from the library's :phpclass:`MongoDB\\Client` class. A
2424
database may also be cloned from an existing :phpclass:`MongoDB\\Database`
25-
object via the :phpmethod:`withOptions() <MongoDB\\Database::withOptions>`
25+
object via the :phpmethod:`withOptions() <MongoDB\\Database::withOptions()>`
2626
method.
2727

2828
:phpclass:`MongoDB\\Database` supports the :php:`readConcern

source/reference/class/MongoDBGridFSBucket.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Definition
2525
You can construct a GridFS bucket using the driver's
2626
:php:`Manager <class.mongodb-driver-manager>` class, or select a bucket from
2727
the library's :phpclass:`MongoDB\\Database` class via the
28-
:phpmethod:`selectGridFSBucket() <MongoDB\\Database::selectGridFSBucket>`
28+
:phpmethod:`selectGridFSBucket() <MongoDB\\Database::selectGridFSBucket()>`
2929
method.
3030

3131
Methods

source/reference/method/MongoDBChangeStream-getCursorId.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ This example reports the cursor ID for a change stream.
4343

4444
var_dump($changeStream->getCursorId());
4545

46-
The output would then resemble::
46+
The output would then resemble:
47+
48+
.. code-block:: none
4749

4850
object(MongoDB\Driver\CursorId)#5 (1) {
4951
["id"]=>

source/reference/method/MongoDBClient-dropDatabase.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ The following example drops the ``test`` database:
5858

5959
var_dump($result);
6060

61-
The output would then resemble::
61+
The output would then resemble:
62+
63+
.. code-block:: none
6264

6365
object(MongoDB\Model\BSONDocument)#8 (1) {
6466
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBClient-getReadConcern.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ Example
4141

4242
var_dump($client->getReadConcern());
4343

44-
The output would then resemble::
44+
The output would then resemble:
45+
46+
.. code-block:: none
4547

4648
object(MongoDB\Driver\ReadConcern)#5 (1) {
4749
["level"]=>

source/reference/method/MongoDBClient-getReadPreference.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Example
4242

4343
var_dump($client->getReadPreference());
4444

45-
The output would then resemble::
45+
The output would then resemble:
46+
47+
.. code-block:: none
4648

4749
object(MongoDB\Driver\ReadPreference)#5 (1) {
4850
["mode"]=>

source/reference/method/MongoDBClient-getTypeMap.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ Example
4545

4646
var_dump($client->getTypeMap());
4747

48-
The output would then resemble::
48+
The output would then resemble:
49+
50+
.. code-block:: none
4951

5052
array(3) {
5153
["root"]=>

source/reference/method/MongoDBClient-getWriteConcern.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Example
4242

4343
var_dump($client->getWriteConcern());
4444

45-
The output would then resemble::
45+
The output would then resemble:
46+
47+
.. code-block:: none
4648

4749
object(MongoDB\Driver\WriteConcern)#4 (1) {
4850
["j"]=>

source/reference/method/MongoDBClient-listDatabaseNames.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ The following example lists all databases on the server:
5959
var_dump($databaseName);
6060
}
6161

62-
The output would then resemble::
62+
The output would then resemble:
63+
64+
.. code-block:: none
6365

6466
string(5) "local"
6567
string(4) "test"

source/reference/method/MongoDBClient-listDatabases.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ The following example lists all databases on the server:
5858
var_dump($databaseInfo);
5959
}
6060

61-
The output would then resemble::
61+
The output would then resemble:
62+
63+
.. code-block:: none
6264

6365
object(MongoDB\Model\DatabaseInfo)#4 (3) {
6466
["name"]=>

source/reference/method/MongoDBClient-startSession.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ The following example starts a new session:
5353

5454
var_dump($session);
5555

56-
The output would then resemble::
56+
The output would then resemble:
57+
58+
.. code-block:: none
5759

5860
object(MongoDB\Driver\Session)#2043 (4) {
5961
["logicalSessionId"]=>

source/reference/method/MongoDBClient__get.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Definition
1717

1818
Selects a database on the server. This :php:`magic method <oop5.magic>` is
1919
an alias for the :phpmethod:`selectDatabase()
20-
<MongoDB\\Client::selectDatabase>` method.
20+
<MongoDB\\Client::selectDatabase()>` method.
2121

2222
.. code-block:: php
2323

@@ -37,7 +37,7 @@ Behavior
3737

3838
The selected database inherits options such as read preference and type mapping
3939
from the :phpclass:`Client <MongoDB\\Client>` object. If you wish to override
40-
any options, use the :phpmethod:`MongoDB\\Client::selectDatabase` method.
40+
any options, use the :phpmethod:`MongoDB\\Client::selectDatabase()` method.
4141

4242
.. note::
4343

source/reference/method/MongoDBCollection-createIndex.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ the ``test`` database.
6666

6767
var_dump($indexName);
6868

69-
The output would then resemble::
69+
The output would then resemble:
70+
71+
.. code-block:: none
7072

7173
string(19) "borough_1_cuisine_1"
7274

@@ -95,7 +97,9 @@ exists.
9597

9698
var_dump($indexName);
9799

98-
The output would then resemble::
100+
The output would then resemble:
101+
102+
.. code-block:: none
99103

100104
string(9) "borough_1"
101105

source/reference/method/MongoDBCollection-createIndexes.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ MongoDB\\Collection::createIndexes()
1313
Definition
1414
----------
1515

16-
.. phpmethod:: MongoDB\\Collection::createIndexes($indexes)
16+
.. phpmethod:: MongoDB\\Collection::createIndexes()
1717

1818
Create one or more indexes for the collection.
1919

@@ -53,7 +53,9 @@ fields that correspond to index options accepted by :phpmethod:`createIndex()
5353

5454
For example, the following ``$indexes`` parameter creates two indexes. The first
5555
is an ascending unique index on the ``username`` field and the second is a
56-
2dsphere index on the ``loc`` field with a custom name::
56+
2dsphere index on the ``loc`` field with a custom name:
57+
58+
.. code-block:: none
5759

5860
[
5961
[ 'key' => [ 'username' => 1 ], 'unique' => true ],
@@ -81,7 +83,9 @@ custom name.
8183

8284
var_dump($indexNames);
8385

84-
The output would then resemble::
86+
The output would then resemble:
87+
88+
.. code-block:: none
8589

8690
array(2) {
8791
[0]=>

source/reference/method/MongoDBCollection-deleteMany.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ that have ``"ny"`` as the value for the ``state`` field:
6868

6969
printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
7070

71-
The output would then resemble::
71+
The output would then resemble:
72+
73+
.. code-block:: none
7274

7375
Deleted 2 document(s)
7476

source/reference/method/MongoDBCollection-deleteOne.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ has ``"ny"`` as the value for the ``state`` field:
7070

7171
printf("Deleted %d document(s)\n", $deleteResult->getDeletedCount());
7272

73-
The output would then resemble::
73+
The output would then resemble:
74+
75+
.. code-block:: none
7476

7577
Deleted 1 document(s)
7678

source/reference/method/MongoDBCollection-distinct.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ in the ``restaurants`` collection in the ``test`` database.
6666

6767
var_dump($distinct);
6868

69-
The output would then resemble::
69+
The output would then resemble:
70+
71+
.. code-block:: none
7072

7173
array(6) {
7274
[0]=>
@@ -100,7 +102,9 @@ the ``borough`` is ``Queens``:
100102

101103
var_dump($distinct);
102104

103-
The output would then resemble::
105+
The output would then resemble:
106+
107+
.. code-block:: none
104108

105109
array(75) {
106110
[0]=>

source/reference/method/MongoDBCollection-drop.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ database:
5959

6060
var_dump($result);
6161

62-
The output would then resemble::
62+
The output would then resemble:
63+
64+
.. code-block:: none
6365

6466
object(MongoDB\Model\BSONDocument)#9 (1) {
6567
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBCollection-dropIndex.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ collection in the ``test`` database:
5959

6060
var_dump($result);
6161

62-
The output would then resemble::
62+
The output would then resemble:
63+
64+
.. code-block:: none
6365

6466
object(MongoDB\Model\BSONDocument)#9 (1) {
6567
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBCollection-dropIndexes.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ The following drops all indexes from the ``restaurants`` collection in the
6060

6161
var_dump($result);
6262

63-
The output would then resemble::
63+
The output would then resemble:
64+
65+
.. code-block:: none
6466

6567
object(MongoDB\Model\BSONDocument)#9 (1) {
6668
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBCollection-explain.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ Explainable Commands
5050

5151
Explainable commands include, but are not limited to:
5252

53-
- :phpclass:`MongoDB\\Operation\\Aggregate`
54-
- :phpclass:`MongoDB\\Operation\\Count`
55-
- :phpclass:`MongoDB\\Operation\\DeleteMany`
56-
- :phpclass:`MongoDB\\Operation\\DeleteOne`
57-
- :phpclass:`MongoDB\\Operation\\Distinct`
58-
- :phpclass:`MongoDB\\Operation\\Find`
59-
- :phpclass:`MongoDB\\Operation\\FindOne`
60-
- :phpclass:`MongoDB\\Operation\\FindOneAndDelete`
61-
- :phpclass:`MongoDB\\Operation\\FindOneAndReplace`
62-
- :phpclass:`MongoDB\\Operation\\FindOneAndUpdate`
63-
- :phpclass:`MongoDB\\Operation\\UpdateMany`
64-
- :phpclass:`MongoDB\\Operation\\UpdateOne`
53+
- ``MongoDB\Operation\Aggregate``
54+
- ``MongoDB\Operation\Count``
55+
- ``MongoDB\Operation\DeleteMany``
56+
- ``MongoDB\Operation\DeleteOne``
57+
- ``MongoDB\Operation\Distinct``
58+
- ``MongoDB\Operation\Find``
59+
- ``MongoDB\Operation\FindOne``
60+
- ``MongoDB\Operation\FindOneAndDelete``
61+
- ``MongoDB\Operation\FindOneAndReplace``
62+
- ``MongoDB\Operation\FindOneAndUpdate``
63+
- ``MongoDB\Operation\UpdateMany``
64+
- ``MongoDB\Operation\UpdateOne``
6565

6666
Examples
6767
--------
@@ -84,7 +84,9 @@ This example explains a count command.
8484

8585
var_dump($result);
8686

87-
The output would then resemble::
87+
The output would then resemble:
88+
89+
.. code-block:: none
8890

8991
object(MongoDB\Model\BSONDocument)#29 (1) {
9092
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBCollection-find.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ returned. It also limits the results to 5 documents.
7777
var_dump($restaurant);
7878
};
7979

80-
The output would then resemble::
80+
The output would then resemble:
81+
82+
.. code-block:: none
8183

8284
object(MongoDB\Model\BSONDocument)#10 (1) {
8385
["storage":"ArrayObject":private]=>

source/reference/method/MongoDBCollection-findOne.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ returned.
9898

9999
var_dump($restaurant);
100100

101-
The output would then resemble::
101+
The output would then resemble:
102+
103+
.. code-block:: none
102104

103105
object(MongoDB\Model\BSONDocument)#10 (1) {
104106
["storage":"ArrayObject":private]=>

0 commit comments

Comments
 (0)