Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| LoginHandler | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| handle | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace AppDemo\User\Application\Query; |
| 11 | |
| 12 | use Override; |
| 13 | use Phexium\Application\Query\AbstractQueryHandler; |
| 14 | use Phexium\Application\Query\QueryHandlerInterface; |
| 15 | use Phexium\Application\Query\QueryInterface; |
| 16 | use Phexium\Application\Query\QueryResponseInterface; |
| 17 | use Phexium\Domain\TypeGuard; |
| 18 | |
| 19 | final class LoginHandler extends AbstractQueryHandler implements QueryHandlerInterface |
| 20 | { |
| 21 | #[Override] |
| 22 | public function handle(QueryInterface $query): QueryResponseInterface |
| 23 | { |
| 24 | TypeGuard::that($query)->isInstanceOf(LoginQuery::class); |
| 25 | |
| 26 | return new LoginQueryResponse($query->email); |
| 27 | } |
| 28 | } |