diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-12 04:44:22 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-01-12 04:44:22 +0300 |
commit | ff9e415fb23ae06aa68a73e2c3dcf32ff092444b (patch) | |
tree | 5aa0963d3283010a14e67107736f218765dd2005 /plugins/LanguagesManager | |
parent | 636d5400a7aee9fff5b3966b06c5d4e248ce825c (diff) |
Simplified get from container with new shorter method
Diffstat (limited to 'plugins/LanguagesManager')
5 files changed, 7 insertions, 7 deletions
diff --git a/plugins/LanguagesManager/Commands/CompareKeys.php b/plugins/LanguagesManager/Commands/CompareKeys.php index 60364ac39d..fbbe803a6e 100644 --- a/plugins/LanguagesManager/Commands/CompareKeys.php +++ b/plugins/LanguagesManager/Commands/CompareKeys.php @@ -51,7 +51,7 @@ class CompareKeys extends TranslationBase $englishFromOTrance = json_decode(file_get_contents($englishFromOTrance), true); /** @var Translator $translator */ - $translator = StaticContainer::getContainer()->get('Piwik\Translation\Translator'); + $translator = StaticContainer::get('Piwik\Translation\Translator'); $translator->setCurrentLanguage('en'); $availableTranslations = $translator->getAllTranslations(); diff --git a/plugins/LanguagesManager/Commands/FetchFromOTrance.php b/plugins/LanguagesManager/Commands/FetchFromOTrance.php index ae130b0bc6..8802209ced 100644 --- a/plugins/LanguagesManager/Commands/FetchFromOTrance.php +++ b/plugins/LanguagesManager/Commands/FetchFromOTrance.php @@ -25,7 +25,7 @@ class FetchFromOTrance extends TranslationBase protected function configure() { - $path = StaticContainer::getContainer()->get('path.tmp') . self::DOWNLOAD_PATH; + $path = StaticContainer::get('path.tmp') . self::DOWNLOAD_PATH; $this->setName('translations:fetch') ->setDescription('Fetches translations files from oTrance to ' . $path) @@ -171,7 +171,7 @@ class FetchFromOTrance extends TranslationBase public static function getDownloadPath() { - $path = StaticContainer::getContainer()->get('path.tmp') . self::DOWNLOAD_PATH; + $path = StaticContainer::get('path.tmp') . self::DOWNLOAD_PATH; if (!is_dir($path)) { mkdir($path); diff --git a/plugins/LanguagesManager/LanguagesManager.php b/plugins/LanguagesManager/LanguagesManager.php index afd60dc53d..9d81a7655f 100644 --- a/plugins/LanguagesManager/LanguagesManager.php +++ b/plugins/LanguagesManager/LanguagesManager.php @@ -95,7 +95,7 @@ class LanguagesManager extends \Piwik\Plugin public function initLanguage() { /** @var Translator $translator */ - $translator = StaticContainer::getContainer()->get('Piwik\Translation\Translator'); + $translator = StaticContainer::get('Piwik\Translation\Translator'); $language = Common::getRequestVar('language', '', 'string'); if (empty($language)) { diff --git a/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php b/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php index 6f8baa28a9..00966cbe95 100644 --- a/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php +++ b/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php @@ -211,7 +211,7 @@ class WriterTest extends \PHPUnit_Framework_TestCase public function getTranslationPathTemporaryTestData() { - $tmpPath = StaticContainer::getContainer()->get('path.tmp'); + $tmpPath = StaticContainer::get('path.tmp'); return array( array('de', null, $tmpPath . '/de.json'), diff --git a/plugins/LanguagesManager/TranslationWriter/Writer.php b/plugins/LanguagesManager/TranslationWriter/Writer.php index a4f0f06a23..6095f5a982 100644 --- a/plugins/LanguagesManager/TranslationWriter/Writer.php +++ b/plugins/LanguagesManager/TranslationWriter/Writer.php @@ -199,14 +199,14 @@ class Writer if (!empty($this->pluginName)) { if ($base == 'tmp') { - return sprintf('%s/plugins/%s/lang/%s.json', StaticContainer::getContainer()->get('path.tmp'), $this->pluginName, $lang); + return sprintf('%s/plugins/%s/lang/%s.json', StaticContainer::get('path.tmp'), $this->pluginName, $lang); } else { return sprintf('%s/plugins/%s/lang/%s.json', PIWIK_INCLUDE_PATH, $this->pluginName, $lang); } } if ($base == 'tmp') { - return sprintf('%s/%s.json', StaticContainer::getContainer()->get('path.tmp'), $lang); + return sprintf('%s/%s.json', StaticContainer::get('path.tmp'), $lang); } return sprintf('%s/%s/%s.json', PIWIK_INCLUDE_PATH, $base, $lang); |