Skip to content

Commit b337cbd

Browse files
committed
Add HandlerFailedException to CommandBus::dispatch @throws
Without declaring it, catching the exception forces `@phpstan-ignore catch.neverThrown` everywhere, which is a bad pattern. Signed-off-by: Nicolo Singer <nicolo@whatwedo.ch>
1 parent 584f17b commit b337cbd

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/CommandBus/CommandBus.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@
44

55
namespace Patchlevel\EventSourcing\CommandBus;
66

7+
use Symfony\Component\Messenger\Exception\HandlerFailedException;
8+
79
interface CommandBus
810
{
9-
/** @throws HandlerNotFound */
11+
/**
12+
* @throws HandlerNotFound
13+
* @throws HandlerFailedException
14+
*/
1015
public function dispatch(object $command): void;
1116
}

0 commit comments

Comments
 (0)