Total Complexity | 8 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
4 | class FieldValueConverter { |
||
5 | /** |
||
6 | * @param array<string, mixed> $row |
||
7 | * @param array<string, string> $columnDefinitions |
||
8 | * @return array<string, mixed> |
||
9 | */ |
||
10 | public static function convertValues(array $row, array $columnDefinitions): array { |
||
11 | $result = []; |
||
12 | foreach($row as $key => $value) { |
||
13 | if($value !== null) { |
||
14 | $result[$key] = self::convertValue($value, $columnDefinitions[$key]); |
||
15 | } else { |
||
16 | $result[$key] = $value; |
||
17 | } |
||
18 | } |
||
19 | return $result; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param mixed $value |
||
24 | * @param string $type |
||
25 | * @return mixed |
||
26 | */ |
||
27 | private static function convertValue($value, string $type) { |
||
33 | } |
||
34 | } |
||
35 |