MCPcopy Create free account
hub / github.com/error311/FileRise / coreConfigFromRaw

Method coreConfigFromRaw

src/FileRise/Storage/SourcesConfig.php:141–161  ·  view source on GitHub ↗
(array $raw)

Source from the content-addressed store, hash-verified

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 {

Callers 5

getConfigMethod · 0.95
getPublicConfigMethod · 0.95
getAdminListMethod · 0.95
getSourceMethod · 0.95
getFirstEnabledSourceMethod · 0.95

Calls 3

rawSourceMapMethod · 0.95
normalizeSourceStoredMethod · 0.95
defaultLocalSourceMethod · 0.95

Tested by

no test coverage detected