Skip to content

[Messenger] fix Envelope::all() conditional return docblock #58977

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/Messenger/Envelope.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@
*
* @return StampInterface[]|StampInterface[][] The stamps for the specified FQCN, or all stamps by their class name
*
* @psalm-return ($stampFqcn is string : array<class-string<StampInterface>, list<StampInterface>> ? list<TStamp>)
* @psalm-return ($stampFqcn is null ? array<class-string<StampInterface>, list<StampInterface>> : list<TStamp>)

Check failure on line 115 in src/Symfony/Component/Messenger/Envelope.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidReturnType

src/Symfony/Component/Messenger/Envelope.php:115:22: InvalidReturnType: The declared return type 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, (TStamp:fn-symfony\component\messenger\envelope::all as Symfony\Component\Messenger\Stamp\StampInterface)|list<Symfony\Component\Messenger\Stamp\StampInterface>>' for Symfony\Component\Messenger\Envelope::all is incorrect, got 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, Symfony\Component\Messenger\Stamp\StampInterface|list<Symfony\Component\Messenger\Stamp\StampInterface>>' (see https://psalm.dev/011)

Check failure on line 115 in src/Symfony/Component/Messenger/Envelope.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidReturnType

src/Symfony/Component/Messenger/Envelope.php:115:22: InvalidReturnType: The declared return type 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, (TStamp:fn-symfony\component\messenger\envelope::all as Symfony\Component\Messenger\Stamp\StampInterface)|list<Symfony\Component\Messenger\Stamp\StampInterface>>' for Symfony\Component\Messenger\Envelope::all is incorrect, got 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, Symfony\Component\Messenger\Stamp\StampInterface|list<Symfony\Component\Messenger\Stamp\StampInterface>>' (see https://psalm.dev/011)
*/
public function all(?string $stampFqcn = null): array
{
if (null !== $stampFqcn) {
return $this->stamps[$stampFqcn] ?? [];

Check failure on line 120 in src/Symfony/Component/Messenger/Envelope.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidReturnStatement

src/Symfony/Component/Messenger/Envelope.php:120:20: InvalidReturnStatement: The inferred type 'list<Symfony\Component\Messenger\Stamp\StampInterface>' does not match the declared return type 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, (TStamp:fn-symfony\component\messenger\envelope::all as Symfony\Component\Messenger\Stamp\StampInterface)|list<Symfony\Component\Messenger\Stamp\StampInterface>>' for Symfony\Component\Messenger\Envelope::all (see https://psalm.dev/128)

Check failure on line 120 in src/Symfony/Component/Messenger/Envelope.php

View workflow job for this annotation

GitHub Actions / Psalm

InvalidReturnStatement

src/Symfony/Component/Messenger/Envelope.php:120:20: InvalidReturnStatement: The inferred type 'list<Symfony\Component\Messenger\Stamp\StampInterface>' does not match the declared return type 'array<class-string<Symfony\Component\Messenger\Stamp\StampInterface>|int<0, max>, (TStamp:fn-symfony\component\messenger\envelope::all as Symfony\Component\Messenger\Stamp\StampInterface)|list<Symfony\Component\Messenger\Stamp\StampInterface>>' for Symfony\Component\Messenger\Envelope::all (see https://psalm.dev/128)
}

return $this->stamps;
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy