Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
DetailBookJsonPresenter
100.00% covered (success)
100.00%
11 / 11
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 present
100.00% covered (success)
100.00%
11 / 11
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\Library\Presentation;
11
12use AppDemo\Library\Application\Query\DetailBookResponse;
13use Phexium\Presentation\PresenterAbstract;
14use Phexium\Presentation\PresenterInterface;
15
16final class DetailBookJsonPresenter extends PresenterAbstract implements PresenterInterface
17{
18    public function present(DetailBookResponse $response): self
19    {
20        $data = [
21            'id' => $response->id,
22            'title' => $response->title,
23            'author' => $response->author,
24            'isbn' => $response->isbn,
25            'status' => $response->status,
26        ];
27
28        $this->viewModel = [
29            'book' => $data,
30        ];
31
32        return $this;
33    }
34}