Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
14.29% |
1 / 7 |
|
33.33% |
1 / 3 |
CRAP | |
0.00% |
0 / 1 |
| LogoutDTO | |
14.29% |
1 / 7 |
|
33.33% |
1 / 3 |
8.67 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| toArray | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| fromRequest | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Domain\Login\DTOs; |
| 4 | |
| 5 | use Domain\Shared\Interfaces\DataTransferObjectInterface; |
| 6 | use Illuminate\Foundation\Http\FormRequest; |
| 7 | use Illuminate\Support\Str; |
| 8 | |
| 9 | readonly final class LogoutDTO implements DataTransferObjectInterface |
| 10 | { |
| 11 | private string $email; |
| 12 | private string $password; |
| 13 | private int $access_level; |
| 14 | public ?string $expo_token; |
| 15 | |
| 16 | public function __construct(array $args) |
| 17 | { |
| 18 | $this->expo_token = $args['expo_token'] ?? null; |
| 19 | } |
| 20 | |
| 21 | public function toArray(): array |
| 22 | { |
| 23 | return [ |
| 24 | 'expo_token' => $this->expo_token, |
| 25 | ]; |
| 26 | } |
| 27 | |
| 28 | public static function fromRequest(FormRequest $request): self |
| 29 | { |
| 30 | return new self([ |
| 31 | 'expo_token' => $request->validated('expo_token') |
| 32 | ]); |
| 33 | } |
| 34 | } |