public convertLemmaToStructuredArray ( array $lemmas ) : array | ||
$lemmas | array | an array of lemma eg: [ 'message.lemma.child' => string(83) "/Users/potsky/WTF/laravel-localization-helpers/tests/mock/trans.php" , ... ] |
return | array | a structured array of lemma eg: array(1) { 'message' => array(2) { 'lemma' => array(9) { 'child' => string(83) "/Users/potsky/Work/Private/GitHub/laravel-localization-helpers/tests/mock/trans.php" ... |
public function convertLemmaToStructuredArray($lemmas)
{
$lemmas_structured = array();
foreach ($lemmas as $key => $value) {
if (strpos($key, '.') === false) {
$this->messageBag->writeLine(' <error>' . $key . '</error> in file <comment>' . $this->getShortPath($value) . '</comment> <error>will not be included because it has no family</error>');
} else {
array_set($lemmas_structured, $key, $value);
}
}
return $lemmas_structured;
}