[TASK] Use @inject annotation in extensionmanager 19/22619/3
authorIngo Pfennigstorf <i.pfennigstorf@gmail.com>
Fri, 26 Jul 2013 23:12:43 +0000 (01:12 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 27 Jul 2013 11:42:31 +0000 (13:42 +0200)
This patch removes all occurences of injectFooBar methods from the
extensionmanager sysext and replaces them with the @inject
annotation.

Releases: 6.2
Fixes: #50482
Change-Id: Idc55d15e3a4d6086529864e4013478983b9c45e7
Reviewed-on: https://review.typo3.org/22619
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
18 files changed:
typo3/sysext/extensionmanager/Classes/Controller/ActionController.php
typo3/sysext/extensionmanager/Classes/Controller/ConfigurationController.php
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php
typo3/sysext/extensionmanager/Classes/Domain/Model/DownloadQueue.php
typo3/sysext/extensionmanager/Classes/Domain/Model/Extension.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/ExtensionRepository.php
typo3/sysext/extensionmanager/Classes/Service/ExtensionManagementService.php
typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php
typo3/sysext/extensionmanager/Classes/Utility/DownloadUtility.php
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php
typo3/sysext/extensionmanager/Tests/Unit/Controller/UpdateFromTerControllerTest.php
typo3/sysext/extensionmanager/Tests/Unit/Service/ExtensionManagementServiceTest.php
typo3/sysext/extensionmanager/Tests/Unit/Task/UpdateExtensionListTaskTest.php

index e3f6ebf..e619f65 100644 (file)
@@ -36,41 +36,23 @@ class ActionController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCo
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+        * @inject
         */
        protected $fileHandlingUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+        * @inject
         */
        protected $managementService;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
-        */
-       public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility) {
-               $this->fileHandlingUtility = $fileHandlingUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
-        */
-       public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService) {
-               $this->managementService = $managementService;
-       }
-
-       /**
         * Toggle extension installation state action
         *
         * @param string $extension
index a088616..a5b2635 100644 (file)
@@ -35,18 +35,11 @@ class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository
+        * @inject
         */
        protected $configurationItemRepository;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository $configurationItemRepository
-        * @return void
-        */
-       public function injectConfigurationItemRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository $configurationItemRepository) {
-               $this->configurationItemRepository = $configurationItemRepository;
-       }
-
-       /**
         * Show the extension configuration form. The whole form field handling is done
         * in the corresponding view helper
         *
index d87accb..c3c647b 100644 (file)
@@ -35,72 +35,35 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        protected $extensionRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+        * @inject
         */
        protected $fileHandlingUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+        * @inject
         */
        protected $managementService;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility
+        * @inject
         */
        protected $downloadUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        * @return void
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
-        * Dependency injection of the Extension Repository
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
-        * @return void
-        */
-       public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility) {
-               $this->fileHandlingUtility = $fileHandlingUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
-        * @return void
-        */
-       public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService) {
-               $this->managementService = $managementService;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility
-        * @return void
-        */
-       public function injectDownloadUtility(\TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility) {
-               $this->downloadUtility = $downloadUtility;
-       }
-
-       /**
         * Check extension dependencies
         *
         * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
index 52e2176..77a4b57 100644 (file)
@@ -35,46 +35,23 @@ class ListController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCont
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        protected $extensionRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
-        * Dependency injection of the Extension Repository
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
         * @var \TYPO3\CMS\Core\Page\PageRenderer
+        * @inject
         */
        protected $pageRenderer;
 
        /**
-        * @param \TYPO3\CMS\Core\Page\PageRenderer $pageRenderer
-        * @return void
-        */
-       public function injectPageRenderer(\TYPO3\CMS\Core\Page\PageRenderer $pageRenderer) {
-               $this->pageRenderer = $pageRenderer;
-       }
-
-       /**
         * Add the needed JavaScript files for all actions
         */
        public function initializeAction() {
index b7114ab..bf595cd 100644 (file)
@@ -35,63 +35,29 @@ class UpdateFromTerController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
+        * @inject
         */
        protected $repositoryHelper;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository
+        * @inject
         */
        protected $repositoryRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        protected $extensionRepository;
 
        /**
-        * Dependency injection of the Extension Repository
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
-        * Dependency injection of the Repository Helper Utility
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper
-        * @return void
-        */
-       public function injectRepositoryHelper(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper) {
-               $this->repositoryHelper = $repositoryHelper;
-       }
-
-       /**
-        * Dependency injection of repository repository
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository
-        * @return void
-        */
-       public function injectRepositoryRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository) {
-               $this->repositoryRepository = $repositoryRepository;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
         * Update extension list from TER
         *
         * @param boolean $forceUpdateCheck
index 9a53fdb..6b81046 100644 (file)
@@ -36,44 +36,23 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+        * @inject
         */
        protected $fileHandlingUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
+        * @inject
         */
        protected $terUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
-        * @return void
-        */
-       public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility) {
-               $this->fileHandlingUtility = $fileHandlingUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility
-        * @return void
-        */
-       public function injectTerUtility(\TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility) {
-               $this->terUtility = $terUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        * @return void
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
         * Render upload extension form
         *
         * @return void
index 97607c6..33f9fdd 100644 (file)
@@ -49,18 +49,11 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
         * Adds an extension to the download queue.
         * If the extension was already requested in a different version
         * an exception is thrown.
index 5965d22..9624071 100644 (file)
@@ -68,6 +68,7 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        * @inject
         */
        protected $objectManager;
 
@@ -163,14 +164,6 @@ class Extension extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $position = 0;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * @param string $authorEmail
         * @return void
         */
index 1819d50..1620a40 100644 (file)
@@ -37,20 +37,11 @@ class ExtensionRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
 
        /**
         * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper
+        * @inject
         */
        protected $dataMapper;
 
        /**
-        * Injects the DataMapper to map records to objects
-        *
-        * @param \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper
-        * @return void
-        */
-       public function injectDataMapper(\TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper $dataMapper) {
-               $this->dataMapper = $dataMapper;
-       }
-
-       /**
         * Do not include pid in queries
         *
         * @return void
index f2b06ee..a6dd995 100644 (file)
@@ -35,70 +35,35 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue
+        * @inject
         */
        protected $downloadQueue;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
+        * @inject
         */
        protected $dependencyUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue $downloadQueue
-        * @return void
-        */
-       public function injectDownloadQueue(\TYPO3\CMS\Extensionmanager\Domain\Model\DownloadQueue $downloadQueue) {
-               $this->downloadQueue = $downloadQueue;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility
-        * @return void
-        */
-       public function injectDependencyUtility(\TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility) {
-               $this->dependencyUtility = $dependencyUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        * @return void
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility
+        * @inject
         */
        protected $downloadUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility
-        * @return void
-        */
-       public function injectDownloadUtility(\TYPO3\CMS\Extensionmanager\Utility\DownloadUtility $downloadUtility) {
-               $this->downloadUtility = $downloadUtility;
-       }
-
-       /**
         * @param string $extensionKey
         * @return void
         */
index 17694f0..473da84 100644 (file)
@@ -35,26 +35,31 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        * @inject
         */
        protected $objectManager;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        protected $extensionRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+        * @inject
         */
        protected $emConfUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService
+        * @inject
         */
        protected $managementService;
 
@@ -69,46 +74,6 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        protected $errors = array();
 
        /**
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
-        * @return void
-        */
-       public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility) {
-               $this->emConfUtility = $emConfUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService
-        * @return void
-        */
-       public function injectManagementService(\TYPO3\CMS\Extensionmanager\Service\ExtensionManagementService $managementService) {
-               $this->managementService = $managementService;
-       }
-
-       /**
         * Setter for available extensions
         * gets available extensions from list utility if not already done
         *
index f7c4ac2..b2aaeec 100644 (file)
@@ -35,11 +35,13 @@ class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility
+        * @inject
         */
        protected $terUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
+        * @inject
         */
        protected $repositoryHelper;
 
@@ -49,35 +51,12 @@ class DownloadUtility implements \TYPO3\CMS\Core\SingletonInterface {
        protected $downloadPath = 'Local';
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility
-        * @return void
-        */
-       public function injectTerUtility(\TYPO3\CMS\Extensionmanager\Utility\Connection\TerUtility $terUtility) {
-               $this->terUtility = $terUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper
-        * @return void
-        */
-       public function injectRepositoryHelper(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper $repositoryHelper) {
-               $this->repositoryHelper = $repositoryHelper;
-       }
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+        * @inject
         */
        protected $fileHandlingUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility
-        * @return void
-        */
-       public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility) {
-               $this->fileHandlingUtility = $fileHandlingUtility;
-       }
-
-       /**
         * Download an extension
         *
         * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
index 488adf4..858618c 100644 (file)
@@ -36,35 +36,17 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+        * @inject
         */
        protected $emConfUtility;
 
        /**
-        * Injector for Tx_Extensionmanager_Utility_EmConf
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
-        * @return void
-        */
-       public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility) {
-               $this->emConfUtility = $emConfUtility;
-       }
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
-        * Injector for Tx_Extensionmanager_Utility_Install
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        * @return void
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
         * Unpack an extension in t3x data format and write files
         *
         * @param array $extensionData
index df0ed40..fda64d7 100644 (file)
@@ -35,82 +35,47 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        * @inject
         */
        public $objectManager;
 
        /**
         * @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService
+        * @inject
         */
        public $installToolSqlParser;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility
+        * @inject
         */
        protected $dependencyUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
+        * @inject
         */
        protected $fileHandlingUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\ListUtility
+        * @inject
         */
        protected $listUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\DatabaseUtility
+        * @inject
         */
        protected $databaseUtility;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        public $extensionRepository;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility
-        * @return void
-        */
-       public function injectListUtility(\TYPO3\CMS\Extensionmanager\Utility\ListUtility $listUtility) {
-               $this->listUtility = $listUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $filehandlingUtility
-        * @return void
-        */
-       public function injectFileHandlingUtility(\TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility $fileHandlingUtility) {
-               $this->fileHandlingUtility = $fileHandlingUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility
-        * @return void
-        */
-       public function injectDependencyUtility(\TYPO3\CMS\Extensionmanager\Utility\DependencyUtility $dependencyUtility) {
-               $this->dependencyUtility = $dependencyUtility;
-       }
-
-       /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\DatabaseUtility $databaseUtility
-        * @return void
-        */
-       public function injectDatabaseUtility(\TYPO3\CMS\Extensionmanager\Utility\DatabaseUtility $databaseUtility) {
-               $this->databaseUtility = $databaseUtility;
-       }
-
-       /**
-        * Inject emConfUtility
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
         * __construct
         */
        public function __construct() {
index fbb6529..aa05ec2 100644 (file)
@@ -40,61 +40,29 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        * @inject
         */
        public $objectManager;
 
        /**
-        * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
-        * @return void
-        */
-       public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
-               $this->objectManager = $objectManager;
-       }
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility
+        * @inject
         */
        public $emConfUtility;
 
        /**
-        * Inject emConfUtility
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility
-        * @return void
-        */
-       public function injectEmConfUtility(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility $emConfUtility) {
-               $this->emConfUtility = $emConfUtility;
-       }
-
-       /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
+        * @inject
         */
        public $extensionRepository;
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
+        * @inject
         */
        protected $installUtility;
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility
-        * @return void
-        */
-       public function injectInstallUtility(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility) {
-               $this->installUtility = $installUtility;
-       }
-
-       /**
-        * Inject emConfUtility
-        *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository
-        * @return void
-        */
-       public function injectExtensionRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository $extensionRepository) {
-               $this->extensionRepository = $extensionRepository;
-       }
-
-       /**
         * Returns the list of available, but not necessarily loaded extensions
         *
         * @return array Array with two sub-arrays, list array (all extensions with info) and category index
index 6c9c441..cf983da 100644 (file)
@@ -46,7 +46,7 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
                $repositoryHelperMock->expects($this->once())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(0));
-               $controllerMock->injectExtensionRepository($extensionRepositoryMock);
+               $controllerMock->_set('extensionRepository', $extensionRepositoryMock);
 
                $controllerMock->_set('repositoryRepository', $repositoryRepositoryMock);
                $controllerMock->_set('repositoryHelper', $repositoryHelperMock);
@@ -72,7 +72,7 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
                $repositoryHelperMock->expects($this->never())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(100));
-               $controllerMock->injectExtensionRepository($extensionRepositoryMock);
+               $controllerMock->_set('extensionRepository', $extensionRepositoryMock);
 
                $controllerMock->_set('repositoryRepository', $repositoryRepositoryMock);
                $controllerMock->_set('repositoryHelper', $repositoryHelperMock);
@@ -98,7 +98,7 @@ class UpdateFromTerControllerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
                $repositoryHelperMock->expects($this->once())->method('updateExtList');
                $extensionRepositoryMock = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
                $extensionRepositoryMock->expects($this->once())->method('countAll')->will($this->returnValue(100));
-               $controllerMock->injectExtensionRepository($extensionRepositoryMock);
+               $controllerMock->_set('extensionRepository', $extensionRepositoryMock);
 
                $controllerMock->_set('repositoryRepository', $repositoryRepositoryMock);
                $controllerMock->_set('repositoryHelper', $repositoryHelperMock);
index 3aa4ee7..ef88cc4 100644 (file)
@@ -54,7 +54,7 @@ class UpdateExtensionListTaskTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTest
         * @test
         */
        public function updateExtensionListTaskIsInstanceOfAbstractTask() {
-               $taskMock = $this->getMock('TYPO3\CMS\Extensionmanager\Task\\UpdateExtensionListTask');
+               $taskMock = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Task\\UpdateExtensionListTask');
                $this->assertInstanceOf('TYPO3\\CMS\\Scheduler\\Task\\AbstractTask', $taskMock);
        }