Skip to content

Commit 5dda098

Browse files
authored
PHPLIB-954: Add return types to all methods (#1391)
* Test with PHPC 2.0 Squashed commit of the following: commit bc37a4b83e86edba06f97148d9a1b4a194623097 Author: Andreas Braun <[email protected]> Date: Thu Sep 19 13:32:18 2024 +0200 TMP: Use branch reporting 2.0 version for testing commit 938c4cd5be825b605a01e1f3129a2e233c62ac1b Author: Andreas Braun <[email protected]> Date: Wed Sep 18 10:49:01 2024 +0200 Update CI config to test with ext-mongodb 2.0 commit 23b11ec Author: Andreas Braun <[email protected]> Date: Wed Sep 18 10:47:33 2024 +0200 Require ext-mongodb 2.0 * Remove compatibility layer for CursorId deprecation Squashed commit of the following: commit b06bffe Author: Andreas Braun <[email protected]> Date: Thu Sep 19 12:56:07 2024 +0200 Update psalm baseline commit bb4bb56 Author: Andreas Braun <[email protected]> Date: Thu Sep 19 12:55:52 2024 +0200 Remove CursorInterface::getId compatibility layer commit 00fa5e4 Author: Andreas Braun <[email protected]> Date: Thu Sep 19 12:55:32 2024 +0200 Add temporary stubs for cursor classes in 2.x * PHPLIB-954: Add return types to all methods * PHPLIB-1114: Replace Cursor types with CursorInterface * Add upgrade note
1 parent aefbb46 commit 5dda098

File tree

93 files changed

+515
-878
lines changed

Some content is hidden

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

93 files changed

+515
-878
lines changed

.evergreen/config/generated/build/build-extension.yml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/templates/build/build-extension.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
vars:
66
PHP_VERSION: "%phpVersion%"
77
- func: "compile extension"
8-
# TODO: remove once 1.20.0 is released
8+
# TODO: remove once 2.0.0 is released
99
vars:
10-
EXTENSION_BRANCH: "v1.20"
10+
EXTENSION_BRANCH: "v2.x"
1111
- func: "upload extension"
12-
# TODO: re-enable once 1.20.0 is released
12+
# TODO: re-enable once 2.0.0 is released
1313
# - name: "build-php-%phpVersion%-lowest"
1414
# tags: ["build", "php%phpVersion%", "lowest", "pr", "tag"]
1515
# commands:
@@ -18,7 +18,7 @@
1818
# PHP_VERSION: "%phpVersion%"
1919
# - func: "compile extension"
2020
# vars:
21-
# EXTENSION_VERSION: "1.20.0"
21+
# EXTENSION_VERSION: "2.0.0"
2222
# - func: "upload extension"
2323
# - name: "build-php-%phpVersion%-next-stable"
2424
# tags: ["build", "php%phpVersion%", "next-stable", "pr", "tag"]
@@ -28,7 +28,7 @@
2828
# PHP_VERSION: "%phpVersion%"
2929
# - func: "compile extension"
3030
# vars:
31-
# EXTENSION_BRANCH: "v1.20.0"
31+
# EXTENSION_BRANCH: "v2.0"
3232
# - func: "upload extension"
3333
# - name: "build-php-%phpVersion%-next-minor"
3434
# tags: ["build", "php%phpVersion%", "next-minor"]
@@ -38,5 +38,5 @@
3838
# PHP_VERSION: "%phpVersion%"
3939
# - func: "compile extension"
4040
# vars:
41-
# EXTENSION_BRANCH: "master"
41+
# EXTENSION_BRANCH: "v2.x"
4242
# - func: "upload extension"

.github/workflows/coding-standards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ on:
1313

1414
env:
1515
PHP_VERSION: "8.2"
16-
# TODO: change to "stable" once 1.20.0 is released
16+
# TODO: change to "stable" once 2.0.0 is released
1717
# DRIVER_VERSION: "stable"
18-
DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20"
18+
DRIVER_VERSION: "mongodb/mongo-php-driver@v2.x"
1919

2020
jobs:
2121
phpcs:

.github/workflows/generator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ on:
1313

1414
env:
1515
PHP_VERSION: "8.2"
16-
# TODO: change to "stable" once 1.20.0 is released
16+
# TODO: change to "stable" once 2.0.0 is released
1717
# DRIVER_VERSION: "stable"
18-
DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20"
18+
DRIVER_VERSION: "mongodb/mongo-php-driver@v2.x"
1919

2020
jobs:
2121
psalm:

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ on:
1919

2020
env:
2121
PHP_VERSION: "8.2"
22-
# TODO: change to "stable" once 1.20.0 is released
22+
# TODO: change to "stable" once 2.0.0 is released
2323
# DRIVER_VERSION: "stable"
24-
DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20"
24+
DRIVER_VERSION: "mongodb/mongo-php-driver@v2.x"
2525

2626
jobs:
2727
psalm:

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ on:
1212
- "feature/*"
1313

1414
env:
15-
# TODO: change to "stable" once 1.20.0 is released
15+
# TODO: change to "stable" once 2.0.0 is released
1616
# DRIVER_VERSION: "stable"
17-
DRIVER_VERSION: "mongodb/mongo-php-driver@v1.20"
17+
DRIVER_VERSION: "mongodb/mongo-php-driver@v2.x"
1818

1919
jobs:
2020
phpunit:

UPGRADE-2.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ UPGRADE FROM 1.x to 2.0
22
========================
33

44
* Classes in the namespace `MongoDB\Operation\` are `final`.
5+
* All methods in interfaces and classes now define a return type.
56

67
GridFS
78
------

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"php": "^8.1",
1414
"ext-json": "*",
15-
"ext-mongodb": "^1.20.0",
15+
"ext-mongodb": "^2.0",
1616
"composer-runtime-api": "^2.0",
1717
"psr/log": "^1.1.4|^2|^3",
1818
"symfony/polyfill-php80": "^1.27",

phpcs.xml.dist

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@
133133
</rule>
134134

135135

136-
<!-- *********************************************************** -->
137-
<!-- Require native type hints for all code without a BC promise -->
138-
<!-- *********************************************************** -->
139-
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
140-
<exclude-pattern>src</exclude-pattern>
141-
</rule>
142-
143-
144136
<!-- ************************************************************* -->
145137
<!-- Ignore errors for certain files where this is part of the API -->
146138
<!-- ************************************************************* -->

0 commit comments

Comments
 (0)