CodeExplorer writeJsonFile example
$missingSnippetStruct->
getFilePath() );
$json =
$this->snippetFileHandler->
openJsonFile($newPath);
$json =
$this->
addTranslationUsingSnippetKey( $json,
$missingSnippetStruct->
getTranslation(),
$missingSnippetStruct->
getKeyPath() );
$this->snippetFileHandler->
writeJsonFile($newPath,
$json);
} } private function addTranslationUsingSnippetKey(array
$json, string
$translation, string
$key): array
{ $keyParts =
explode('.',
$key);
$currentJson = &
$json;
$lastKey =
end($keyParts);
reset($keyParts);
foreach ($keyParts as $keyPart) {