8000 minor #58066 [Messenger] Improve type annotation of `WrappedException… · symfony/symfony@daa8d6a · GitHub
[go: up one dir, main page]

Skip to content

Commit daa8d6a

Browse files
minor #58066 [Messenger] Improve type annotation of WrappedExceptionsTrait (HypeMC)
This PR was merged into the 7.2 branch. Discussion ---------- [Messenger] Improve type annotation of `WrappedExceptionsTrait` | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Helps static analysis tools. Commits ------- 9af8054 [Messenger] Improve type annotation of `WrappedExceptionsTrait`
2 parents b3d9138 + 9af8054 commit daa8d6a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Symfony/Component/Messenger/Exception/WrappedExceptionsInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@
1919
interface WrappedExceptionsInterface extends \Throwable
2020
{
2121
/**
22+
* @template TClass of class-string<\Throwable>
23+
*
24+
* @param TClass|null $class
25+
*
2226
* @return \Throwable[]
27+
*
28+
* @psalm-return (TClass is null ? \Throwable[] : TClass[])
2329
*/
2430
public function getWrappedExceptions(?string $class = null, bool $recursive = false): array;
2531
}

src/Symfony/Component/Messenger/Exception/WrappedExceptionsTrait.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ trait WrappedExceptionsTrait
2121
private array $exceptions;
2222

2323
/**
24+
* @template TClass of class-string<\Throwable>
25+
*
26+
* @param TClass|null $class
27+
*
2428
* @return \Throwable[]
29+
*
30+
* @psalm-return (TClass is null ? \Throwable[] : TClass[])
2531
*/
2632
public function getWrappedExceptions(?string $class = null, bool $recursive = false): array
2733
{

0 commit comments

Comments
 (0)
0