Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
14.29% covered (danger)
14.29%
1 / 7
33.33% covered (danger)
33.33%
1 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
IntegrationSupplierDTO
14.29% covered (danger)
14.29%
1 / 7
33.33% covered (danger)
33.33%
1 / 3
8.67
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 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 IntegrationSupplierDTO implements DataTransferObjectInterface
9{
10    public string $integrationCode;
11
12
13    public function __construct(array $args)
14    {
15        $this->integrationCode = $args['codFor'];
16    }
17
18    public function toArray(): array
19    {
20        return [
21            'CODFOR' => $this->integrationCode,
22        ];
23    }
24
25    public static function fromRequest(FormRequest $request): IntegrationSupplierDTO
26    {
27        return new self([
28            'codFor' => $request->validated('codFor'),
29        ]);
30    }
31
32}