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

Method rawSourceMap

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

Source from the content-addressed store, hash-verified

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 {

Callers 3

coreConfigFromRawMethod · 0.95
upsertSourceMethod · 0.95
deleteSourceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected