Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
IntegrationCustomerDTO
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 fromRequest
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Domain\Integration\DTOs;
4
5use Domain\Shared\Interfaces\DataTransferObjectInterface;
6use Illuminate\Foundation\Http\FormRequest;
7
8class IntegrationCustomerDTO implements DataTransferObjectInterface
9{
10    public ?string $integrationCode;
11
12
13    public function __construct(array $args)
14    {
15        $this->integrationCode = $args['integration_code'] ?? null;
16    }
17
18    public function toArray(): array
19    {
20        return [
21            'integration_code' => $this->integrationCode,
22        ];
23    }
24
25    public static function fromRequest(FormRequest $request): IntegrationCustomerDTO
26    {
27        return new self([
28            'integration_code' => $request->validated('integration_code'),
29        ]);
30    }
31
32}