-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-601: Document upcoming typing changes #985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alcaeus
merged 8 commits into
mongodb:master
from
alcaeus:phplib-601-document-typing-changes
Oct 7, 2022
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c16b037
Fix wrong information about group helper in upgrade guide
alcaeus cb4b49d
Rename upgrade guide to "Legacy Driver Upgrade Guide"
alcaeus 55840bd
PHPLIB-601: Document upcoming typing changes
alcaeus 9a7ad62
Update method signatures in documentation
alcaeus 63ffc4f
Rename upgrade file to account for new version number
alcaeus 6f51c9e
Document method signature changes by class
alcaeus 284ba38
Fix wrong method signature in docs
alcaeus a9fc31e
Fix syntax and update wording
alcaeus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# UPGRADE FROM 1.x to 1.15 | ||
|
||
## Method signature changes | ||
|
||
### Parameter types | ||
|
||
Starting with 1.15, methods now declare types for their arguments. This will not | ||
cause BC breaks unless you've passed a type that was incompatible with the type | ||
previously documented in the PHPDoc comment. A list of changes can be found at | ||
the bottom of this document. | ||
|
||
### Return types | ||
|
||
Return types will be added in version 2.0. These types are documented in a | ||
PHPDoc comment and will eventually become a declared return type. You can | ||
prepare for this change (which will trigger a BC break in any class you may | ||
extend) by adding the correct return type to your class at this time. | ||
|
||
## Internal classes | ||
|
||
Internal classes (i.e. annotated with `@internal`) will become final where | ||
possible in a future release. At the same time, we will add return types to | ||
these internal classes. Note that internal classes are not covered by our | ||
backward compatibility promise, and you should not instantiate such classes | ||
directly. | ||
|
||
## Method signature changes by class | ||
|
||
### MongoDB\Client | ||
|
||
| 1.13 | 1.15 | | ||
|-----------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------| | ||
| `__construct($uri = 'mongodb://127.0.0.1', array $uriOptions = [], array $driverOptions = [])` | `__construct(?string $uri = null, array $uriOptions = [], array $driverOptions = [])` | | ||
| `__get($databaseName)` | `__get(string $databaseName)` | | ||
| `dropDatabase($databaseName, array $options = [])` | `dropDatabase(string $databaseName, array $options = [])` | | ||
| `selectCollection($databaseName, $collectionName, array $options = [])` | `selectCollection(string $databaseName, string $collectionName, array $options = [])` | | ||
| `selectDatabase($databaseName, array $options = [])` | `selectDatabase(string $databaseName, array $options = [])` | | ||
|
||
### MongoDB\Database | ||
|
||
| 1.13 | 1.15 | | ||
|-----------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------| | ||
| `__construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])` | `__construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = [])` | | ||
| `__get($collectionName)` | `__get(string $collectionName)` | | ||
| `createCollection($collectionName, array $options = [])` | `createCollection(string $collectionName, array $options = [])` | | ||
| `dropCollection($collectionName, array $options = [])` | `dropCollection(string $collectionName, array $options = [])` | | ||
| `modifyCollection($collectionName, array $collectionOptions, array $options = [])` | `modifyCollection(string $collectionName, array $collectionOptions, array $options = [])` | | ||
| `selectCollection($collectionName, array $options = [])` | `selectCollection(string $collectionName, array $options = [])` | | ||
|
||
### MongoDB\Collection | ||
|
||
| 1.13 | 1.15 | | ||
|----------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------| | ||
| `__construct(MongoDB\Driver\Manager $manager, $databaseName, $collectionName, array $options = [])` | `__construct(MongoDB\Driver\Manager $manager, string $databaseName, string $collectionName, array $options = [])` | | ||
| `distinct($fieldName, $filter = [], array $options = [])` | `distinct(string $fieldName, $filter = [], array $options = [])` | | ||
|
||
### MongoDB\GridFS\Bucket | ||
|
||
| 1.13 | 1.15 | | ||
|-----------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------| | ||
| `__construct(MongoDB\Driver\Manager $manager, $databaseName, array $options = [])` | `__construct(MongoDB\Driver\Manager $manager, string $databaseName, array $options = [])` | | ||
| `downloadToStreamByName($filename, $destination, array $options = [])` | `downloadToStreamByName(string $filename, $destination, array $options = [])` | | ||
| `openDownloadStreamByName($filename, array $options = [])` | `openDownloadStreamByName(string $filename, array $options = [])` | | ||
| `openUploadStream($filename, array $options = [])` | `openUploadStream(string $filename, array $options = [])` | | ||
| `uploadFromStream($filename, $source, array $options = [])` | `uploadFromStream(string $filename, $source, array $options = [])` | | ||
| `rename($id, $newFilename)` | `rename($id, string $newFilename)` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
============= | ||
Upgrade Guide | ||
============= | ||
=========================== | ||
Legacy Driver Upgrade Guide | ||
=========================== | ||
|
||
.. default-domain:: mongodb | ||
|
||
|
@@ -281,7 +281,7 @@ inadvertent and potentially dangerous :manual:`full-document replacements | |
Group Command Helper | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
:phpclass:`MongoDB\\Collection` does have a helper method for the | ||
:phpclass:`MongoDB\\Collection` does not have a helper method for the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's quite the old typo correction! |
||
:manual:`group </reference/command/group>` command. The following example | ||
demonstrates how to execute a group command using the | ||
:phpmethod:`MongoDB\\Database::command()` method: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!