Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
UserDetailResource | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
toArray | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Controllers\Api\Resources; |
6 | |
7 | class UserDetailResource extends UserResource |
8 | { |
9 | public function toArray(): array |
10 | { |
11 | return array_merge(parent::toArray(), [ |
12 | 'email' => $this->model->contact->email ?: $this->model->email, |
13 | 'tshirt_size' => $this->model->personalData->shirt_size, |
14 | 'language' => $this->model->settings->language, |
15 | 'arrived' => $this->model->state->arrived, |
16 | 'dates' => [ |
17 | 'planned_arrival' => $this->model->personalData->planned_arrival_date, |
18 | 'planned_departure' => $this->model->personalData->planned_departure_date, |
19 | 'arrival' => $this->model->state->arrival_date, |
20 | ], |
21 | ]); |
22 | } |
23 | } |