1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace RemotelyLiving\PHPCommandBus\Tests\Stubs\Handlers; |
||
6 | |||
7 | use RemotelyLiving\PHPCommandBus\Interfaces; |
||
8 | use RemotelyLiving\PHPCommandBus\Tests\Stubs\Commands; |
||
9 | use RemotelyLiving\PHPCommandBus\Tests\Stubs\Events; |
||
10 | |||
11 | class ReserveRoom implements Interfaces\Handler |
||
12 | { |
||
13 | public function handle(object $command, Interfaces\CommandBus $bus) |
||
14 | { |
||
15 | \assert(($command instanceof Commands\ReserveRoom), 'Command is instance of ReserveRoom'); |
||
16 | |||
17 | yield new Events\RoomWasReserved(); |
||
0 ignored issues
–
show
|
|||
18 | } |
||
19 | } |
||
20 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: