PHPC-2140: Make tentative return types definitive#1658
Merged
alcaeus merged 4 commits intomongodb:v2.xfrom Sep 19, 2024
Merged
Conversation
835aafa to
4a3cec7
Compare
GromNaN
reviewed
Sep 18, 2024
4aebdee to
fc1f63f
Compare
jmikola
approved these changes
Sep 18, 2024
| interface CursorInterface extends \Iterator | ||
| { | ||
| /** @tentative-return-type */ | ||
| public function current(): array|object|null {} |
Contributor
There was a problem hiding this comment.
Do I assume correctly that only current() and key() are included here because those are the only methods where we'd narrowing the return type from the parent interface?
Member
There was a problem hiding this comment.
This methods are mentioned in the upgrade file:
The return types for the
keyandcurrentmethods have been narrowed to the types returned by cursor instances.
GromNaN
approved these changes
Sep 18, 2024
fc1f63f to
ddf31af
Compare
alcaeus
added a commit
that referenced
this pull request
Oct 29, 2024
* v2.x: (22 commits) PHPC-2441: Remove deprecated Manager constructor options (#1719) PHPC-990: Strict type validation for boolean URI options (#1713) PHPC-2440: Remove deprecated Query constructor options (#1707) PHPC-2459: Remove support for float arg in UTCDateTime ctor (#1709) Remove obsolete test PHPC-2344 Remove SSLConnectionException (#1696) PHPC-2144 Throw a LogicException when getting info from unacknowledged write result (#1687) PHPC-2454: Remove --enable-system-ciphers configure option (#1681) PHPC-2348 Remove `WriteException` and move `getWriteResult` to `BulkWriteException` (#1685) PHPC-2417 Add UTCDateTimeInterface::toDateTimeImmutable() (#1684) PHPC-2309: Remove --with-openssl-dir configure option (#1676) PHPC-2444: Remove support for string arguments in UTCDateTime constructor (#1662) PHPC-2248: Remove Serializable implementations (#1663) Update version for 2.x branch (#1672) PHPC-1021: Remove support for ReadPreference integer modes (#1666) PHPC-2342: Remove --with-libbson and --with-libmongoc configure options (#1667) PHPC-2351: Remove CursorId class (#1664) PHPC-2140: Make tentative return types definitive (#1658) PHPC-2402: Remove range_preview constants (#1665) PHPC-2346: Remove deprecated BSON functions (#1653) ...
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PHPC-2140
This PR removes the
@tentative-return-typeannotation in all stub files, making the return types definitive and causing errors if an extending or implementing class does not have a covariant return type.It also changes the return types for various methods in
MongoDB\Driver\ManagerandMongoDB\Driver\ServerfromCursortoCursorInterface.Note: currently contains changes from #1653 to avoid fixing tests that will be removed.