| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public static function getStructuredData(array $data, bool $includeAll = true): array |
||
| 33 | { |
||
| 34 | $asArray = self::asArray(); |
||
| 35 | $structured = []; |
||
| 36 | |||
| 37 | foreach ($asArray as $key => $value) { |
||
| 38 | if (! $includeAll && ! array_key_exists($key, $data)) { |
||
| 39 | continue; |
||
| 40 | } |
||
| 41 | |||
| 42 | $structured[$value] = $data[$key] ?? null; |
||
| 43 | } |
||
| 44 | |||
| 45 | return $structured; |
||
| 46 | } |
||
| 48 |