Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
LoginHandler
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 handle
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
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
8declare(strict_types=1);
9
10namespace AppDemo\User\Application\Query;
11
12use Override;
13use Phexium\Application\Query\AbstractQueryHandler;
14use Phexium\Application\Query\QueryHandlerInterface;
15use Phexium\Application\Query\QueryInterface;
16use Phexium\Application\Query\QueryResponseInterface;
17use Phexium\Domain\TypeGuard;
18
19final 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}