-
Notifications
You must be signed in to change notification settings - Fork 99
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
Invalid map in collection. #621
Comments
/cc @xificurk Is it possible you broke this with your stubs? Thanks. |
I does not use any custom stubs. |
You use phpstan-doctrine which includes a lot of them. |
Yes. But before commit #620, my code working without error. |
Hm, I might be missing some phpstan internals knowledge, but (to my surprise), it looks like the stub phpdoc from ReadableCollection::map takes precedence not only over original ReadableCollection::map phpdoc, but even original Collection::map. |
I'm running into the same issue, using /**
* @return Collection<int, TopicItem>
*/
public function getItems(): Collection
{
$livestreamStartLimiter = new \DateTimeImmutable(self::LIVESTREAM_START_LIMITER);
return $this->items->filter(function (TopicItem $topicItem) use ($livestreamStartLimiter): bool {
// simplified code here
return true;
});
}
This happens while upgrading |
It'seem that we have to update the What happens if we remove all this collection stub files ? |
Exact same situation here. |
Fixed #622 |
I just downloaded the last version (1.5.5) and it is work as expected ! Great job !!!! |
Thank you, 1.5.5 works for me, too! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
After update PHPStan to version 1.5.4, the map function of collection does not work anymore.
Example:
The follwing error is raised:
Maybe, the
Collection
andArrayCollection
stubs must be also updated.The text was updated successfully, but these errors were encountered: