Skip to content

Commit e7ce816

Browse files
authored
Merge branch 'master' into merge-v1.18-into-master-1715369105478
2 parents cd051e2 + 783dba8 commit e7ce816

12 files changed

+51
-49
lines changed

.github/workflows/tests.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- "8.1"
3737
- "8.2"
3838
- "8.3"
39+
- "8.4"
3940
mongodb-version:
4041
- "4.4"
4142
topology:
@@ -104,7 +105,10 @@ jobs:
104105
- name: "Install dependencies with Composer"
105106
uses: "ramsey/[email protected]"
106107
with:
107-
composer-options: "--no-suggest"
108+
# Revert when psalm supports PHP 8.4
109+
# composer-options: "--no-suggest"
110+
composer-options: "--no-suggest ${{ matrix.php-version == '8.4' && '--ignore-platform-req=php+' || '' }}"
111+
108112

109113
- name: "Run PHPUnit"
110114
run: "vendor/bin/simple-phpunit -v"

RELEASING.md

+12-29
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ changes in this maintenance branch. This is important because we will later
4141
merge the ensuing release commits up to master with `--strategy=ours`, which
4242
will ignore changes from the merged commits.
4343

44-
## Update composer.json and CI matrices
44+
## Update extension requirement
4545

46-
This is especially important before releasing a new minor version.
46+
In `composer.json`, ensure that the version of `ext-mongodb` is correct for
47+
the library version being released.
48+
49+
## Update CI matrices
4750

48-
Ensure that the extension requirement and branch alias in `composer.json` are
49-
correct for the library version being released. For example, the 1.15.0 release
50-
of the library should depend on version `^1.15.0` of the extension and master
51-
branch alias should be `1.15.x-dev`.
51+
This is especially important before releasing a new minor version.
5252

5353
If this is the first release of a minor version for the library, it is likely
5454
following an extension release. The `vars` for calling `compile extension` from
@@ -90,21 +90,22 @@ After releasing a new major or minor version (e.g. 1.9.0), a maintenance branch
9090
1.9.1) would then be done within that branch and any development for the next
9191
major or minor release can continue in master.
9292

93-
After creating a maintenance branch, the `extra.branch-alias.dev-master` field
94-
in the master branch's `composer.json` file should be updated. For example,
95-
after branching v1.9, `composer.json` in the master branch may still read:
93+
When work begins on a major new version, create a maintenance branch for the
94+
last minor version and update the `extra.branch-alias.dev-master` field
95+
in the master branch's `composer.json` file. For example, after branching v1.99,
96+
`composer.json` in the master branch may still read:
9697

9798
```
9899
"branch-alias": {
99-
"dev-master": "1.9.x-dev"
100+
"dev-master": "1.x-dev"
100101
}
101102
```
102103

103104
The above would be changed to:
104105

105106
```
106107
"branch-alias": {
107-
"dev-master": "1.10.x-dev"
108+
"dev-master": "2.x-dev"
108109
}
109110
```
110111

@@ -124,24 +125,6 @@ $ git checkout -b vX.Y
124125
$ git push mongodb vX.Y
125126
```
126127

127-
Update the master branch alias in `composer.json`:
128-
129-
```diff
130-
"extra": {
131-
"branch-alias": {
132-
- "dev-master": "1.15.x-dev"
133-
+ "dev-master": "1.16.x-dev"
134-
}
135-
},
136-
```
137-
138-
Commit and push this change:
139-
140-
```console
141-
$ git commit -m "Master is now X.Y-dev" composer.json
142-
$ git push mongodb
143-
```
144-
145128
### After releasing a patch version
146129

147130
If this was a patch release, the maintenance branch must be merged up to master:

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"extra": {
5555
"branch-alias": {
56-
"dev-master": "1.18.x-dev"
56+
"dev-master": "1.x-dev"
5757
}
5858
},
5959
"config": {

docs/includes/extracts-option-requires.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,4 @@ source:
4545
replacement:
4646
version: "7.0"
4747
...
48+

docs/reference/method/MongoDBClient-addSubscriber.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ notified once of each event for this Client.
5050
Example
5151
-------
5252

53-
Create a :php:`MongoDB\Driver\Monitoring\CommandSubscriber
54-
<manual/en/class.mongodb-driver-monitoring-commandsubscriber>` that
55-
logs all events:
53+
Create a :php:`MongoDB\Driver\Monitoring\CommandSubscriber <manual/en/class.mongodb-driver-monitoring-commandsubscriber>`
54+
that logs all events:
5655

5756
.. code-block:: php
5857

docs/reference/method/MongoDBCollection-dropIndexes.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ Parameters
2727

2828
``$indexName`` : string| :phpclass:`MongoDB\Model\IndexInfo`
2929
The name or model object of the index to drop. View the existing indexes on
30-
the collection using the :phpmethod:`listIndexes()
31-
<MongoDB\Collection::listIndexes()>` method.
30+
the collection by using the :phpmethod:`MongoDB\Collection::listIndexes()` method.
3231

3332
``$options`` : array
3433
An array specifying the desired options.

docs/reference/method/MongoDBCollection-updateMany.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Parameters
3333

3434
``$update`` : array|object
3535
Specifies the field and value combinations to update and any relevant update
36-
operators. ``$update`` uses MongoDB's :manual:`update operators
37-
</reference/operator/update>`. Starting with MongoDB 4.2, an `aggregation
38-
pipeline <https://mongodb.com/docs/master/reference/command/update/#update-with-an-aggregation-pipeline>`_
36+
operators. ``$update`` uses MongoDB's :manual:`update operators </reference/operator/update>`.
37+
Starting with MongoDB 4.2, an `aggregation pipeline
38+
<https://mongodb.com/docs/master/reference/command/update/#update-with-an-aggregation-pipeline>`_
3939
can be passed as this parameter.
4040

4141
``$options`` : array

docs/tutorial/encryption.txt

-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Additionally, either ``crypt_shared`` or ``mongocryptd`` are required in order t
2323
use *automatic* client-side encryption. Neither is required for *explicit*
2424
encryption.
2525

26-
2726
``crypt_shared``
2827
~~~~~~~~~~~~~~~~
2928

@@ -43,7 +42,6 @@ fail if it cannot be loaded.
4342
For detailed installation instructions see the MongoDB documentation for the
4443
:manual:`Automatic Encryption Shared Library </core/queryable-encryption/reference/shared-library/>`.
4544

46-
4745
``mongocryptd``
4846
~~~~~~~~~~~~~~~
4947

@@ -74,7 +72,6 @@ the spawning behavior via various auto encryption
7472
``mongocryptd`` is only responsible for supporting automatic client-side encryption
7573
and does not itself perform any encryption or decryption.
7674

77-
7875
Managing Encryption Keys
7976
------------------------
8077

@@ -105,7 +102,6 @@ encryption key (e.g. user-specific encryption keys) or create them dynamically.
105102
.. literalinclude:: /examples/encryption/create_data_key.php
106103
:language: php
107104

108-
109105
.. _alt_name:
110106

111107
Referencing Encryption Keys by an Alternative Name

src/functions.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
use function is_string;
4646
use function MongoDB\BSON\fromPHP;
4747
use function MongoDB\BSON\toPHP;
48+
use function str_ends_with;
4849
use function substr;
4950

5051
/**
@@ -497,7 +498,7 @@ function create_field_path_type_map(array $typeMap, string $fieldPath): array
497498
/* Special case if we want to convert an array, in which case we need to
498499
* ensure that the field containing the array is exposed as an array,
499500
* instead of the type given in the type map's array key. */
500-
if (substr($fieldPath, -2, 2) === '.$') {
501+
if (str_ends_with($fieldPath, '.$')) {
501502
$typeMap['fieldPaths'][substr($fieldPath, 0, -2)] = 'array';
502503
}
503504

tests/UnifiedSpecTests/Constraint/Matches.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
use function PHPUnit\Framework\logicalOr;
3838
use function range;
3939
use function sprintf;
40-
use function strpos;
40+
use function str_starts_with;
4141
use function strrchr;
4242

4343
/**
@@ -373,7 +373,7 @@ private static function getOperatorName(BSONDocument $document): string
373373
{
374374
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
375375
foreach ($document as $key => $_) {
376-
if (strpos((string) $key, '$$') === 0) {
376+
if (str_starts_with((string) $key, '$$')) {
377377
return $key;
378378
}
379379
}
@@ -394,7 +394,7 @@ private static function isOperator(BSONDocument $document): bool
394394

395395
// phpcs:ignore Squiz.NamingConventions.ValidVariableName.NotCamelCaps
396396
foreach ($document as $key => $_) {
397-
return strpos((string) $key, '$$') === 0;
397+
return str_starts_with((string) $key, '$$');
398398
}
399399

400400
throw new LogicException('should not reach this point');

tests/UnifiedSpecTests/UnifiedTestRunner.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
use function PHPUnit\Framework\assertNotFalse;
3636
use function preg_replace;
3737
use function sprintf;
38+
use function str_starts_with;
3839
use function strlen;
3940
use function strpos;
4041
use function substr_replace;
@@ -528,7 +529,7 @@ private function createContext(): Context
528529
// We assume the internal client URI has multiple mongos hosts
529530
$multiMongosUri = $this->internalClientUri;
530531

531-
if (strpos($multiMongosUri, 'mongodb+srv://') === 0) {
532+
if (str_starts_with($multiMongosUri, 'mongodb+srv://')) {
532533
/* TODO: If an SRV URI is provided, we can consider connecting and
533534
* checking the topology for multiple mongoses and then selecting a
534535
* single mongos to reconstruct a single mongos URI; however, that

tests/UnifiedSpecTests/command-monitoring/unacknowledgedBulkWrite.json

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"description": "unacknowledgedBulkWrite",
3-
"schemaVersion": "1.0",
3+
"schemaVersion": "1.7",
44
"createEntities": [
55
{
66
"client": {
@@ -64,11 +64,29 @@
6464
],
6565
"ordered": false
6666
}
67+
},
68+
{
69+
"name": "find",
70+
"object": "collection",
71+
"arguments": {
72+
"filter": {}
73+
},
74+
"expectResult": [
75+
{
76+
"_id": 1,
77+
"x": 11
78+
},
79+
{
80+
"_id": "unorderedBulkWriteInsertW0",
81+
"x": 44
82+
}
83+
]
6784
}
6885
],
6986
"expectEvents": [
7087
{
7188
"client": "client",
89+
"ignoreExtraEvents": true,
7290
"events": [
7391
{
7492
"commandStartedEvent": {

0 commit comments

Comments
 (0)