-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Document more BC breaks #2012
Document more BC breaks #2012
Conversation
* Introduce new iterator interface to allow people to update typehints * Deprecate CommandCursor and Cursor class * Remove deprecation warning from EagerCursor class Since we're now deprecating all cursor classes, we can't really trigger deprecation warnings anymore since any read operation in MongoDB would cause deprecations that a user can't solve. Thus, we rely on other ways of deprecating these classes.
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.
The code looks good, not sure why 5.6 is unhappy with it 🤔
ac8c84e
to
67be37d
Compare
Coverage seems to have imported the |
IMO it's just not worth it. A sentence like "We've added scalar typehints nearly everywhere" will do :) |
@@ -29,6 +29,7 @@ | |||
* | |||
* @since 1.1 | |||
* @author alcaeus <[email protected]> | |||
* @deprecated This class is deprecated and will be removed in 2.0. You should typehint against the {@see Iterator} interface instead. |
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.
it'd be possible to emit a deprecation in the ctor
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.
We still use this class extensively, which would cause deprecation notices users can't fix, which is why I haven't added that.
@@ -37,8 +38,9 @@ | |||
* For compatibility, this class also extends Doctrine\MongoDB\Cursor. | |||
* | |||
* @since 1.0 | |||
* @deprecated This class is deprecated and will be removed in 2.0. You should typehint against the {@see Iterator} interface instead. |
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.
Deprecation in the ctor?
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.
See #2012 (comment).
*/ | ||
class EagerCursor extends Cursor | ||
{ | ||
public function __construct(CursorInterface $baseCursor, UnitOfWork $unitOfWork, ClassMetadata $class) | ||
{ | ||
@trigger_error( |
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.
Why is the notice removed?
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.
See #2012 (comment).
67be37d
to
c2cf938
Compare
Added more deprecations from the list of BC breaks. BC breaks due to type hints are mostly relevant to people extending classes or implementing interfaces, so I'd like to provide this information in a separate UPGRADE document for people that are interested in those particular cases. |
c2cf938
to
1519012
Compare
Summary
This documents all BC breaks from the
REMOVED
category of https://gist.github.com/alcaeus/b8c1b38e297cc957e991683bef069771. It includes a BC layer for theDocumentRepository
deprecation similar to how we handleClassMetadata
. @greg0ire I'd appreciate it if you could take a close look at that particular commit, I'm not entirely sure I didn't mess it up.I'll create a separate PR to go through the other BC breaks the tool reported; I'm not sure we want to document every type hint that we added.