8000 minor #44583 [Messenger] Added generic template for `Envelope::last()… · symfony/symfony@a976d27 · GitHub
[go: up one dir, main page]

Skip to content

Commit a976d27

Browse files
minor #44583 [Messenger] Added generic template for Envelope::last() method (fractalzombie)
This PR was merged into the 6.1 branch. Discussion ---------- [Messenger] Added generic template for `Envelope::last()` method | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | License | MIT Added possibility to PHPStorm generic support for Envelope::last method, no need more `/** `@var` SomeStampClass */` Commits ------- bbdc403 [Messenger] Added generic template for `Envelope::last()` method
2 parents 680eb90 + bbdc403 commit a976d27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Component/Messenger/Envelope.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ public function withoutStampsOfType(string $type): self
9393
return $cloned;
9494
}
9595

96+
/**
97+
* @template TStamp of StampInterface
98+
*
99+
* @param class-string<TStamp> $stampFqcn
100+
*
101+
* @return TStamp|null
102+
*/
96103
public function last(string $stampFqcn): ?StampInterface
97104
{
98105
return isset($this->stamps[$stampFqcn]) ? end($this->stamps[$stampFqcn]) : null;

0 commit comments

Comments
 (0)
0