8000 [Messenger] Improve type annotation of `WrappedExceptionsTrait` · symfony/symfony@9af8054 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9af8054

Browse files
committed
[Messenger] Improve type annotation of WrappedExceptionsTrait
1 parent 310fc6a commit 9af8054

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