Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a976d27

Browse filesBrowse 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
Copy full SHA for a976d27

File tree

1 file changed

+7
-0
lines changed
Filter options

1 file changed

+7
-0
lines changed

‎src/Symfony/Component/Messenger/Envelope.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Envelope.php
+7Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.