mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
Fix implicit variable creation.
This commit is contained in:
@@ -24,26 +24,26 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface,
|
||||
// Array of ancien languages (to exclude)
|
||||
private $ancientToExclude = ["ang", "egy", "fro", "goh", "grc", "la", "non", "peo", "pro", "sga",
|
||||
"dum", "enm", "frm", "gmh", "mga", "akk", "phn", "zxx", "got", "und"];
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @var ContainerInterface
|
||||
*/
|
||||
private $container;
|
||||
|
||||
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
|
||||
public function getOrder() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
|
||||
public function load(ObjectManager $manager) {
|
||||
|
||||
|
||||
echo "loading languages... \n";
|
||||
|
||||
|
||||
foreach (Intl::getLanguageBundle()->getLanguageNames() as $code => $language) {
|
||||
if (
|
||||
!in_array($code, $this->regionalVersionToInclude)
|
||||
@@ -58,23 +58,24 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface,
|
||||
$manager->persist($lang);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* prepare names for languages
|
||||
*
|
||||
* @param string $languageCode
|
||||
* Prepare names for languages.
|
||||
*
|
||||
* @return string[] languages name indexed by available language code
|
||||
*/
|
||||
private function prepareName($languageCode) {
|
||||
private function prepareName(string $languageCode): array {
|
||||
$names = [];
|
||||
|
||||
foreach ($this->container->getParameter('chill_main.available_languages') as $lang) {
|
||||
$names[$lang] = Intl::getLanguageBundle()->getLanguageName($languageCode);
|
||||
}
|
||||
|
||||
|
||||
return $names;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user