foreach ($missingSnippetsCollection->
getIterator() as $missingSnippetStruct) { $question =
sprintf( "<info>Available translation: '%s' in locale '%s'.</info>\n<question>Please enter translation for locale '%s':</question>",
$missingSnippetStruct->
getAvailableTranslation(),
$missingSnippetStruct->
getAvailableISO(),
$missingSnippetStruct->
getMissingForISO() );
$missingSnippetStruct->
setTranslation($questionHelper->
ask($input,
$output,
new Question($question)) ?? ''
);
} $this->snippetFixer->
fix($missingSnippetsCollection);
return self::SUCCESS;
} private function hydrateMissingSnippets(array
$missingSnippetsArray): MissingSnippetCollection
{ $missingSnippetsCollection =
new MissingSnippetCollection();
foreach ($missingSnippetsArray as $locale =>
$missingSnippets) { foreach ($missingSnippets as $key =>
$missingSnippet) { $missingSnippetsCollection->
add(new MissingSnippetStruct($key,
$missingSnippet['path'
],
$missingSnippet['availableISO'
],
$missingSnippet['availableValue'
],
$locale));
} }