Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| SendWelcomeNotificationCommandHandler | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getMessageHandled | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Notification\Infrastructure\EventHandler; |
| 4 | |
| 5 | use App\Notification\Application\Handler\NotificationCommandHandler; |
| 6 | use App\Shared\Infrastructure\EventHandler\CommandHandler; |
| 7 | use App\Shared\Infrastructure\EventHandler\MessageHandler; |
| 8 | use MyLegoCollection\SharedContracts\Command\SendWelcomeNotificationCommand; |
| 9 | use Symfony\Component\Messenger\Attribute\AsMessageHandler; |
| 10 | |
| 11 | /** |
| 12 | * @implements CommandHandler<SendWelcomeNotificationCommand> |
| 13 | * @author Wilhelm Zwertvaegher |
| 14 | */ |
| 15 | #[AsMessageHandler] |
| 16 | readonly class SendWelcomeNotificationCommandHandler implements CommandHandler |
| 17 | { |
| 18 | public function __construct( |
| 19 | private NotificationCommandHandler $notificationCommandHandler |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public static function getMessageHandled(): string |
| 24 | { |
| 25 | return SendWelcomeNotificationCommand::class; |
| 26 | } |
| 27 | |
| 28 | public function __invoke(SendWelcomeNotificationCommand $command): void |
| 29 | { |
| 30 | ($this->notificationCommandHandler)($command); |
| 31 | } |
| 32 | } |