-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Migrate part of the tools namespace to PHP8 syntax #9900
Conversation
* {@inheritdoc} | ||
* | ||
* @return int | ||
*/ | ||
#[ReturnTypeWillChange] |
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 attribute can be removed now.
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.
Oh right, same below.
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 have to look at the files one by one because for instance here, the constructor was not affected by Rector.
c0b915c
to
1f46cda
Compare
I think it will be better to touch the walkers after #9551 is finished. I will remove change to them from this PR |
* @psalm-return ArrayIterator<array-key, T> | ||
*/ | ||
#[ReturnTypeWillChange] | ||
public function getIterator() | ||
public function getIterator(): ArrayIterator |
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 was already an ArrayIterator before, but should this method rely on an Iterator
implementation in the return type instead of the interface itself? Even the name of the method doesn't refer to a specific Iterator implementation.
It's not really a blocker for a merge, but food for thoughts for 3.0.
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.
No, no, I totally see what you mean: if the consumer don't leverage it, why should we provide that level of detail. Here, they shouldn't be calling getIterator()
directly but use a foreach
, so that's one more reason to do this. Let me change that.
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.
Yes, IteratorAggregate
allows to access getIterator()
directly. Technically it should be Traversable
as the docs suggests, but I wasn't sure if this step was a too large for this PR.
That way we have some level of error handling, and don't muddy the return type.
No description provided.