[TASK] Use property injection in LanguageController 34/17534/4
authorSebastian Michaelsen <michaelsen@t3seo.de>
Tue, 15 Jan 2013 09:03:51 +0000 (10:03 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 25 Jan 2013 22:22:23 +0000 (23:22 +0100)
\TYPO3\CMS\Lang\Controller\LanguageController has 4
inject* Methods which a pretty vanilla and can be replaced
by property injection.

Resolves: #44526
Releases: 6.1, 6.0

Change-Id: I37181e2bbbd12c9c7fe7b34fe8adafe6f4becec3
Reviewed-on: https://review.typo3.org/17534
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/lang/Classes/Controller/LanguageController.php

index fcc1810..b12dba0 100644 (file)
@@ -45,21 +45,25 @@ class LanguageController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Repository\LanguageRepository
+        * @inject
         */
        protected $languageRepository;
 
        /**
         * @var \TYPO3\CMS\Lang\Domain\Repository\ExtensionRepository
+        * @inject
         */
        protected $extensionRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
+        * @inject
         */
        protected $repositoryHelper;
 
        /**
         * @var \TYPO3\CMS\Lang\Utility\Connection\Ter
+        * @inject
         */
        protected $terConnection;
 
@@ -75,46 +79,6 @@ class LanguageController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControl
        protected $jsonActions = array('updateTranslation');
 
        /**
-        * Inject the language repository
-        *
-        * @param \TYPO3\CMS\Lang\Domain\Repository\LanguageRepository $repository
-        * @return void
-        */
-       public function injectLanguageRepository(\TYPO3\CMS\Lang\Domain\Repository\LanguageRepository $repository) {
-               $this->languageRepository = $repository;
-       }
-
-       /**
-        * Inject the extension repository
-        *
-        * @param \TYPO3\CMS\Lang\Domain\Repository\ExtensionRepository $repository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Lang\Domain\Repository\ExtensionRepository $repository) {
-               $this->extensionRepository = $repository;
-       }
-
-       /**
-        * Inject the repository helper
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper
-        * @return void
-        */
-       public function injectRepositoryHelper(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper) {
-               $this->repositoryHelper = $repositoryHelper;
-       }
-
-       /**
-        * Inject the repository helper
-        *
-        * @param \TYPO3\CMS\Lang\Utility\Connection\Ter $terConnection
-        * @return void
-        */
-       public function injectTerConnection(\TYPO3\CMS\Lang\Utility\Connection\Ter $terConnection) {
-               $this->terConnection = $terConnection;
-       }
-
-       /**
         * Force JSON output for defined actions
         *
         * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view The view to be initialized