(array $raw)
| 117 | } |
| 118 | |
| 119 | private static function rawSourceMap(array $raw): array |
| 120 | { |
| 121 | $sourcesRaw = isset($raw['sources']) && is_array($raw['sources']) ? $raw['sources'] : []; |
| 122 | $out = []; |
| 123 | |
| 124 | foreach ($sourcesRaw as $key => $src) { |
| 125 | if (!is_array($src)) { |
| 126 | continue; |
| 127 | } |
| 128 | if (!isset($src['id']) && is_string($key)) { |
| 129 | $src['id'] = $key; |
| 130 | } |
| 131 | $id = trim((string)($src['id'] ?? '')); |
| 132 | if ($id === '' || !preg_match('/^[A-Za-z0-9_-]{1,64}$/', $id)) { |
| 133 | continue; |
| 134 | } |
| 135 | $out[$id] = $src; |
| 136 | } |
| 137 | |
| 138 | return $out; |
| 139 | } |
| 140 | |
| 141 | private static function coreConfigFromRaw(array $raw): array |
| 142 | { |
no outgoing calls
no test coverage detected