-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Change Collection::slice() method to return an instance of Collection #196
Conversation
* | ||
* @psalm-return array<TKey,T> | ||
* @psalm-return Collection<TKey, T> |
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.
Should we add @return static
here, and then change the return type hints of implementors to self
when dropping php 7.3?
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.
I am not sure. Can that be done in another issue/PR?
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.
Sure! It's a tiny detail, definitely not a blocker
@@ -268,7 +268,7 @@ public function indexOf($element) | |||
/** | |||
* {@inheritDoc} | |||
*/ | |||
public function slice(int $offset, ?int $length = null) : array | |||
public function slice(int $offset, ?int $length = null) : Collection |
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.
What is the impact of this BC break on the OSS ecosystem? Is ->slice()
called often?
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.
I am not sure. Trying to think of a way to search for that on github somehow.
ab0fc76
to
c694975
Compare
instead of an array.
c694975
to
8e2ab7f
Compare
Oh I just noticed this has been taken over already. Closing in favor of #264 |
Fixes #195