Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public static function from(array $data): self |
||
11 | { |
||
12 | $code = key($data); |
||
13 | $properties = current($data); |
||
14 | |||
15 | assert(is_string($code)); |
||
16 | assert(is_array($properties)); |
||
17 | |||
18 | return new self( |
||
19 | code: $code, |
||
20 | from: $properties['_from'] ?? null, |
||
21 | to: $properties['_to'] ?? null, |
||
22 | tender: ($properties['_tender'] ?? null) != 'false', |
||
23 | ); |
||
34 |