Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| HomeUseCase | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
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 AppStarter\Homepage\Application\UseCase; |
| 11 | |
| 12 | use Phexium\Application\UseCase\UseCaseInterface; |
| 13 | use Phexium\Plugin\Clock\Port\ClockInterface; |
| 14 | |
| 15 | final readonly class HomeUseCase implements UseCaseInterface |
| 16 | { |
| 17 | public function __construct( |
| 18 | private ClockInterface $clock |
| 19 | ) {} |
| 20 | |
| 21 | public function __invoke(HomeRequest $request): HomeResponse |
| 22 | { |
| 23 | $currentDateTime = $this->clock->now(); |
| 24 | |
| 25 | return new HomeResponse($request->greeting, $currentDateTime); |
| 26 | } |
| 27 | } |