private readonly CacheInvalidator
$cacheInvalidator ) { } /**
* @param array<string, string> $snippets
*/
public function updateSnippets(AppEntity
$app, array
$snippets, Context
$context): void
{ $newOrUpdatedSnippets =
[];
$existingSnippets =
$this->
getExistingSnippets($app->
getId(),
$context);
$coreSnippets =
$this->
getCoreAdministrationSnippets();
$firstLevelSnippetKeys =
[];
foreach ($snippets as $snippetString) { $decodedSnippets =
json_decode($snippetString, true, 512, \JSON_THROW_ON_ERROR
);
$firstLevelSnippetKeys =
array_keys($decodedSnippets);
} if ($duplicatedKeys =
array_values(array_intersect(array_keys($coreSnippets),
$firstLevelSnippetKeys))) { throw SnippetException::
extendOrOverwriteCore($duplicatedKeys);
}