Skip to content

Commit b24a1e0

Browse files
committed
[Messenger] Improve type annotation of WrappedExceptionsTrait
1 parent 390d685 commit b24a1e0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Exception/WrappedExceptionsInterface.php

+6
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
}

Exception/WrappedExceptionsTrait.php

+6
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)