Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
UserAngelTypeResource | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
toArray | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Controllers\Api\Resources; |
6 | |
7 | class UserAngelTypeResource extends AngelTypeResource |
8 | { |
9 | public function toArray(): array |
10 | { |
11 | return [ |
12 | ...parent::toArray(), |
13 | 'confirmed' => !$this->model->restricted |
14 | || $this->model->pivot->supporter |
15 | || $this->model->pivot->confirm_user_id, |
16 | 'supporter' => $this->model->pivot->supporter, |
17 | ]; |
18 | } |
19 | } |