Skip to content

Commit 8618c3a

Browse files
committed
Add Throwable to CommandBus::dispatch @throws
Handlers can throw any exception, and without declaring it, catching one forces `@phpstan-ignore catch.neverThrown` everywhere, which is a bad pattern. Signed-off-by: Nicolo Singer <nicolo@whatwedo.ch>
1 parent 584f17b commit 8618c3a

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 Throwable;
8+
79
interface CommandBus
810
{
9-
/** @throws HandlerNotFound */
11+
/**
12+
* @throws HandlerNotFound
13+
* @throws Throwable
14+
*/
1015
public function dispatch(object $command): void;
1116
}

0 commit comments

Comments
 (0)