Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
ShiftWithEntriesResource | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
toArray | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Controllers\Api\Resources; |
6 | |
7 | use Illuminate\Contracts\Support\Arrayable; |
8 | |
9 | class ShiftWithEntriesResource extends ShiftResource |
10 | { |
11 | public function toArray(array | Arrayable $location = [], array | Arrayable $angelTypes = []): array |
12 | { |
13 | return [ |
14 | ...parent::toArray($location), |
15 | 'needed_angel_types' => $angelTypes instanceof Arrayable ? $angelTypes->toArray() : $angelTypes, |
16 | ]; |
17 | } |
18 | } |