(array $raw)
| 139 | } |
| 140 | |
| 141 | private static function coreConfigFromRaw(array $raw): array |
| 142 | { |
| 143 | $enabled = !empty($raw['enabled']); |
| 144 | $sources = []; |
| 145 | |
| 146 | foreach (self::rawSourceMap($raw) as $src) { |
| 147 | $normalized = self::normalizeSourceStored($src); |
| 148 | if ($normalized) { |
| 149 | $sources[$normalized['id']] = $normalized; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | if (!isset($sources[self::DEFAULT_ID])) { |
| 154 | $sources[self::DEFAULT_ID] = self::normalizeSourceStored(self::defaultLocalSource()); |
| 155 | } |
| 156 | |
| 157 | return [ |
| 158 | 'enabled' => $enabled, |
| 159 | 'sources' => $sources, |
| 160 | ]; |
| 161 | } |
| 162 | |
| 163 | private static function normalizeSourceStored(array $src): ?array |
| 164 | { |
no test coverage detected