Skip to content

Commit 11355da

Browse files
Implementing templatable exception type
This pull requests implements generic templates for exceptions implemented in psalm phpstan/phpdoc-parser#51
1 parent 1876747 commit 11355da

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Option.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,13 @@ abstract public function isNone(): bool;
4040
/**
4141
* Unwraps a result, yielding the content of a Some.
4242
*
43+
* @template E of Exception
4344
* @param Exception $msg
45+
* @psalm-param E $msg
4446
* @return mixed
4547
* @psalm-return T
4648
* @throws Exception the message if the value is a None.
49+
* @phpstan-throws E
4750
*/
4851
abstract public function expect(Exception $msg);
4952

0 commit comments

Comments
 (0)