Commit 3d3d7aee authored by Wouter Wolters's avatar Wouter Wolters Committed by Susanne Moog
Browse files

[TASK] Replace @inject with inject methods in ext:extbase

Because of performance reasons we replace
the @inject annotations back to inject methods.

Resolves: #54605
Releases: master
Change-Id: I433e2ecccc2aa319ec8904dbc65b84f63e9959aa
Reviewed-on: http://review.typo3.org/42270


Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: default avatarSusanne Moog <typo3@susannemoog.de>
Tested-by: default avatarSusanne Moog <typo3@susannemoog.de>
parent e8f004ea
......@@ -23,7 +23,6 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
/**
* @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
* @inject
*/
protected $commandManager;
......@@ -32,6 +31,13 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
*/
protected $commandsByExtensionsAndControllers = array();
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
*/
public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
$this->commandManager = $commandManager;
}
/**
* Displays a short, general help message
*
......
......@@ -38,13 +38,11 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
/**
* @var \TYPO3\CMS\Extbase\Service\TypoScriptService
* @inject
*/
protected $typoScriptService;
......@@ -71,10 +69,30 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService
*/
public function injectTypoScriptService(\TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService) {
$this->typoScriptService = $typoScriptService;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject
* @return void
......
......@@ -23,7 +23,6 @@ class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abstr
* Needed to recursively fetch a page tree
*
* @var \TYPO3\CMS\Core\Database\QueryGenerator
* @inject
*/
protected $queryGenerator;
......@@ -38,6 +37,13 @@ class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abstr
*/
protected $currentPageId;
/**
* @param \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator
*/
public function injectQueryGenerator(\TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator) {
$this->queryGenerator = $queryGenerator;
}
/**
* Returns TypoScript Setup array from current Environment.
*
......
......@@ -24,7 +24,6 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -35,10 +34,23 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* Initializes the object
*
......
......@@ -23,10 +23,16 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
/**
* @var \TYPO3\CMS\Extbase\Service\FlexFormService
* @inject
*/
protected $flexFormService;
/**
* @param \TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService
*/
public function injectFlexFormService(\TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService) {
$this->flexFormService = $flexFormService;
}
/**
* Returns TypoScript Setup array from current Environment.
*
......
......@@ -21,10 +21,16 @@ class ModuleRunner implements ModuleRunnerInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManager
* @inject
*/
protected $objectManager;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManager $objectManager) {
$this->objectManager = $objectManager;
}
/**
* This method forwards the call to Bootstrap's run() method. This method is invoked by the BackendModuleRequestHandler
* function of TYPO3.
......
......@@ -23,7 +23,6 @@ class Command {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -55,13 +54,24 @@ class Command {
protected $extensionName;
/**
* Reflection service
*
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* Constructor
*
......
......@@ -23,7 +23,6 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -37,6 +36,13 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
*/
protected $shortCommandIdentifiers = NULL;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* Returns an array of all commands
*
......
......@@ -24,7 +24,6 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -77,6 +76,13 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
*/
protected $callingScript;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param string $callingScript
*/
......
......@@ -23,28 +23,52 @@ class RequestBuilder implements \TYPO3\CMS\Core\SingletonInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
/**
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
* @inject
*/
protected $commandManager;
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @inject
*/
protected $configurationManager;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
*/
public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
$this->commandManager = $commandManager;
}
/**
* @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
*/
public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
$this->configurationManager = $configurationManager;
}
/**
* Builds a CLI request object from a command line.
*
......
......@@ -23,28 +23,52 @@ class RequestHandler implements \TYPO3\CMS\Extbase\Mvc\RequestHandlerInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Dispatcher
* @inject
*/
protected $dispatcher;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder
* @inject
*/
protected $requestBuilder;
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher
*/
public function injectDispatcher(\TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher) {
$this->dispatcher = $dispatcher;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder
*/
public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder) {
$this->requestBuilder = $requestBuilder;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* Handles the request
*
......
......@@ -28,7 +28,6 @@ abstract class AbstractController implements ControllerInterface {
/**
* @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
* @inject
*/
protected $signalSlotDispatcher;
......@@ -73,7 +72,6 @@ abstract class AbstractController implements ControllerInterface {
/**
* @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
* @inject
*/
protected $validatorResolver;
......@@ -82,6 +80,20 @@ abstract class AbstractController implements ControllerInterface {
*/
protected $arguments;
/**
* @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
*/
public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
$this->signalSlotDispatcher = $signalSlotDispatcher;
}
/**
* @param \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver
*/
public function injectValidatorResolver(\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver) {
$this->validatorResolver = $validatorResolver;
}
/**
* An array of supported request types. By default only web requests are supported.
* Modify or replace this array if your specific controller supports certain
......
......@@ -31,13 +31,11 @@ class ActionController extends AbstractController {
/**
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
/**
* @var \TYPO3\CMS\Extbase\Service\CacheService
* @inject
*/
protected $cacheService;
......@@ -93,7 +91,6 @@ class ActionController extends AbstractController {
/**
* @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService
* @inject
* @api
*/
protected $mvcPropertyMappingConfigurationService;
......@@ -114,6 +111,27 @@ class ActionController extends AbstractController {
*/
protected $response;
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\Service\CacheService $cacheService
*/
public function injectCacheService(\TYPO3\CMS\Extbase\Service\CacheService $cacheService) {
$this->cacheService = $cacheService;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
*/
public function injectMvcPropertyMappingConfigurationService(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService) {
$this->mvcPropertyMappingConfigurationService = $mvcPropertyMappingConfigurationService;
}
/**
* Handles a request. The result output is returned by altering the given response.
*
......
......@@ -25,13 +25,11 @@ class Argument {
/**
* @var \TYPO3\CMS\Extbase\Property\PropertyMapper
* @inject
*/
protected $propertyMapper;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration
* @inject
* @var MvcPropertyMappingConfiguration
*/
protected $propertyMappingConfiguration;
......@@ -91,6 +89,20 @@ class Argument {
*/
protected $validationResults = NULL;
/**
* @param \TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper
*/
public function injectPropertyMapper(\TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper) {
$this->propertyMapper = $propertyMapper;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration $propertyMappingConfiguration
*/
public function injectPropertyMappingConfiguration(MvcPropertyMappingConfiguration $propertyMappingConfiguration) {
$this->propertyMappingConfiguration = $propertyMappingConfiguration;
}
/**
* Constructs this controller argument
*
......
......@@ -21,7 +21,6 @@ class Arguments extends \ArrayObject {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -35,6 +34,13 @@ class Arguments extends \ArrayObject {
*/
protected $argumentShortNames = array();
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* Constructor. If this one is removed, reflection breaks.
*/
......
......@@ -76,7 +76,6 @@ class CommandController implements CommandControllerInterface {
/**
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
......@@ -101,6 +100,13 @@ class CommandController implements CommandControllerInterface {
$this->output = $this->objectManager->get(ConsoleOutput::class);
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* Checks if the current request type is supported by the controller.
*
......
......@@ -49,16 +49,28 @@ class ControllerContext {
/**
* @var \TYPO3\CMS\Core\Messaging\FlashMessageService
* @inject
*/
protected $flashMessageService;
/**
* @var \TYPO3\CMS\Extbase\Service\ExtensionService
* @inject
*/
protected $extensionService;
/**
* @param \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService
*/
public function injectFlashMessageService(\TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService) {
$this->flashMessageService = $flashMessageService;
}
/**
* @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
*/
public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService) {
$this->extensionService = $extensionService;
}
/**
* Set the request of the controller
*
......
......@@ -36,10 +36,16 @@ class MvcPropertyMappingConfigurationService implements \TYPO3\CMS\Core\Singleto
* The hash service class to use
*
* @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
* @inject
*/
protected $hashService;
/**
* @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
*/
public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService) {
$this->hashService = $hashService;
}
/**
* Generate a request hash for a list of form fields
*
......
......@@ -27,13 +27,11 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
/**
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
/**
* @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
* @inject
*/
protected $signalSlotDispatcher;
......@@ -42,6 +40,20 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
*/
protected $settings = array();
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
*/
public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
$this->signalSlotDispatcher = $signalSlotDispatcher;