diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index 0f88de89ff99d617999ab4c28d188c0d0b400074..b10a940121a483b1d34ae5c988f994c28463a5b4 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace SimpleSAML\Locale; use Exception; +use Gettext\Generator\ArrayGenerator; use Gettext\Loader\PoLoader; use Gettext\Translations; use Gettext\Translator; @@ -250,8 +251,7 @@ class Localization $file = new File($langPath . $domain . '.po'); if ($this->fileSystem->exists($file->getRealPath()) && $file->isReadable()) { - $poLoader = new PoLoader(); - $translations = $poLoader->loadFile($file); + $translations = (new PoLoader())->loadFile($file); $arrayGenerator = new ArrayGenerator(); $this->translator->addTranslations( $arrayGenerator->generateArray($translations)