Commit 0a090c64 authored by Marc Bastian Heinrichs's avatar Marc Bastian Heinrichs
Browse files

Revert "[TASK] Replace inject methods with @inject; allow @Flow\Inject"

This reverts commit ad7219c2

See https://review.typo3.org/#/c/21997/

More notes on this:
A regex to replace @inject with @Flow\Inject when porting 
Extbase extensions to Flow is very simple and fast.

Additionally @Flow\Inject makes only sense with using "use 
TYPO3\Flow\Annotations as Flow". But with a backported 
annotation parser I expect that we would have annotations 
in "TYPO3\CMS\Extbase\Annotations". Using them as alias 
"Flow" is a bad style as the alias should be "Extbase" then.

Change-Id: I2113b5320f2a6f5dd56cfa7b06469fa1628d2645
Reviewed-on: https://review.typo3.org/22004
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
parent dc494adf
......@@ -36,7 +36,6 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
/**
* @var \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager
* @inject
*/
protected $commandManager;
......@@ -45,6 +44,14 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
*/
protected $commandsByExtensionsAndControllers = array();
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
* @return void
*/
public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
$this->commandManager = $commandManager;
}
/**
* Displays a short, general help message
*
......
......@@ -51,13 +51,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;
......@@ -84,10 +82,33 @@ abstract class AbstractConfigurationManager implements \TYPO3\CMS\Core\Singleton
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService
* @return void
*/
public function injectTypoScriptService(\TYPO3\CMS\Extbase\Service\TypoScriptService $typoScriptService) {
$this->typoScriptService = $typoScriptService;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
* @return void
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* @param \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer $contentObject
* @return void
......
......@@ -33,13 +33,19 @@ namespace TYPO3\CMS\Extbase\Configuration;
class BackendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager {
/**
* Needed to recursively fetch a page tree
*
* @var \TYPO3\CMS\Core\Database\QueryGenerator
* @inject
* @var \TYPO3\CMS\Core\Database\QueryGenerator Needed to recursively fetch a page tree
*/
protected $queryGenerator;
/**
* Inject query generator
*
* @param \TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator
*/
public function injectQueryGenerator(\TYPO3\CMS\Core\Database\QueryGenerator $queryGenerator) {
$this->queryGenerator = $queryGenerator;
}
/**
* @var array
*/
......
......@@ -37,7 +37,6 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -48,10 +47,25 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
/**
* @var \TYPO3\CMS\Extbase\Service\EnvironmentService
* @inject
*/
protected $environmentService;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
* @return void
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* Initializes the object
*
......
......@@ -36,10 +36,17 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
/**
* @var \TYPO3\CMS\Extbase\Service\FlexFormService
* @inject
*/
protected $flexFormService;
/**
* @param \TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService
* @return void
*/
public function injectFlexFormService(\TYPO3\CMS\Extbase\Service\FlexFormService $flexFormService) {
$this->flexFormService = $flexFormService;
}
/**
* Returns TypoScript Setup array from current Environment.
*
......
......@@ -36,7 +36,6 @@ class Command {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -64,9 +63,8 @@ class Command {
* Reflection service
*
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
private $reflectionService;
/**
* Constructor
......@@ -92,6 +90,21 @@ class Command {
$this->commandIdentifier = strtolower($extensionKey . ':' . substr($classNameParts[3], 0, -17) . ':' . $controllerCommandName);
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService Reflection service
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @return string
*/
......
......@@ -33,7 +33,6 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -47,6 +46,14 @@ class CommandManager implements \TYPO3\CMS\Core\SingletonInterface {
*/
protected $shortCommandIdentifiers = NULL;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* Returns an array of all commands
*
......
......@@ -34,7 +34,6 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -82,6 +81,14 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
*/
protected $command = NULL;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager A reference to the object manager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* Sets the dispatched flag
*
......
......@@ -33,22 +33,43 @@ class RequestBuilder {
/**
* @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;
/**
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
* @return void
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager
* @return void
*/
public function injectCommandManager(\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager) {
$this->commandManager = $commandManager;
}
/**
* Builds a CLI request object from a command line.
*
......
......@@ -33,28 +33,56 @@ 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
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher
* @return void
*/
public function injectDispatcher(\TYPO3\CMS\Extbase\Mvc\Dispatcher $dispatcher) {
$this->dispatcher = $dispatcher;
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder
* @return void
*/
public function injectRequestBuilder(\TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder $requestBuilder) {
$this->requestBuilder = $requestBuilder;
}
/**
* @param \TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService
* @return void
*/
public function injectEnvironmentService(\TYPO3\CMS\Extbase\Service\EnvironmentService $environmentService) {
$this->environmentService = $environmentService;
}
/**
* Handles the request
*
......
......@@ -36,7 +36,6 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
/**
* @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
* @inject
*/
protected $signalSlotDispatcher;
......@@ -82,13 +81,11 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
/**
* @var \TYPO3\CMS\Extbase\Property\Mapper
* @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
* @inject
*/
protected $deprecatedPropertyMapper;
/**
* @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver
* @inject
*/
protected $validatorResolver;
......@@ -167,6 +164,17 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
$this->settings = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
}
/**
* Injects the property mapper
*
* @param \TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper The property mapper
* @return void
* @deprecated since Extbase 1.4.0, will be removed two versions after Extbase 6.1
*/
public function injectDeprecatedPropertyMapper(\TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper) {
$this->deprecatedPropertyMapper = $deprecatedPropertyMapper;
}
/**
* Injects the object manager
*
......@@ -178,6 +186,16 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
$this->arguments = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\Arguments');
}
/**
* Injects the validator resolver
*
* @param \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver
* @return void
*/
public function injectValidatorResolver(\TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver) {
$this->validatorResolver = $validatorResolver;
}
/**
* This method is deprecated! For further information have a look at
* the PhpDoc of class \TYPO3\CMS\Extbase\Mvc\Controller\FlashMessageContainer
......@@ -191,6 +209,15 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
$this->flashMessageContainer = $flashMessageContainer;
}
/**
* Injects the signal slot dispatcher
*
* @param \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher
*/
public function injectSignalSlotDispatcher(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher) {
$this->signalSlotDispatcher = $signalSlotDispatcher;
}
/**
* Checks if the current request type is supported by the controller.
*
......
......@@ -36,13 +36,11 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
/**
* @var \TYPO3\CMS\Extbase\Reflection\ReflectionService
* @inject
*/
protected $reflectionService;
/**
* @var \TYPO3\CMS\Extbase\Service\CacheService
* @inject
*/
protected $cacheService;
......@@ -108,11 +106,33 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
/**
* @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService
* @inject
* @api
*/
protected $mvcPropertyMappingConfigurationService;
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
* @return void
*/
public function injectReflectionService(\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService) {
$this->reflectionService = $reflectionService;
}
/**
* @param \TYPO3\CMS\Extbase\Service\CacheService $cacheService
* @return void
*/
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;
}
/**
* Checks if the current request type is supported by the controller.
*
......
......@@ -36,25 +36,21 @@ class Argument {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
/**
* @var \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactory
* @inject
*/
protected $queryFactory;
/**
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
* @inject
*/
protected $configurationManager;
/**
* This is the old property mapper, which has been completely rewritten for 1.4.
* @inject
*
* @var \TYPO3\CMS\Extbase\Property\Mapper
*/
......@@ -64,13 +60,11 @@ class Argument {
* The new, completely rewritten property mapper since Extbase 1.4.
*
* @var \TYPO3\CMS\Extbase\Property\PropertyMapper
* @inject
*/
protected $propertyMapper;
/**
* @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration
* @inject
*/
protected $propertyMappingConfiguration;
......@@ -170,7 +164,6 @@ class Argument {
/**
* @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
* @inject
*/
protected $persistenceManager;
......@@ -193,6 +186,32 @@ class Argument {
$this->dataType = $dataType;
}
/**
* Injects the object manager
*
* @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
* @return void
*/
public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager) {
$this->objectManager = $objectManager;
}
/**
* @param \TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper
* @return void
*/
public function injectDeprecatedPropertyMapper(\TYPO3\CMS\Extbase\Property\Mapper $deprecatedPropertyMapper) {
$this->deprecatedPropertyMapper = $deprecatedPropertyMapper;
}
/**
* @param \TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper
* @return void
*/
public function injectPropertyMapper(\TYPO3\CMS\Extbase\Property\PropertyMapper $propertyMapper) {
$this->propertyMapper = $propertyMapper;
}
/**
* @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService
* @return void
......@@ -203,6 +222,34 @@ class Argument {
$this->dataTypeClassSchema = strpbrk($this->dataType, '_\\') !== FALSE ? $this->reflectionService->getClassSchema($this->dataType) : NULL;
}
/**
* Injects the Persistence Manager
*
* @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
* @return void
*/
public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager) {
$this->persistenceManager = $persistenceManager;
}
/**
* Injects a QueryFactory instance
*
* @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory
* @return void
*/
public function injectQueryFactory(\TYPO3\CMS\Extbase\Persistence\Generic\QueryFactoryInterface $queryFactory) {
$this->queryFactory = $queryFactory;
}
/**
* @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
* @return void
*/
public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager) {
$this->configurationManager = $configurationManager;
}
/**
* @param \TYPO3\CMS\Extbase\Service\TypeHandlingService $typeHandlingService
* @return void
......@@ -212,6 +259,14 @@ class Argument {
$this->dataType = $this->typeHandlingService->normalizeType($this->dataType);
}
/**
* @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration $mvcPropertyMappingConfiguration
* @return void
*/
public function injectPropertyMappingConfiguration(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfiguration $mvcPropertyMappingConfiguration) {
$this->propertyMappingConfiguration = $mvcPropertyMappingConfiguration;
}
/**
* Returns the name of this argument
*
......
......@@ -34,7 +34,6 @@ class Arguments extends \ArrayObject {
/**
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
* @inject
*/
protected $objectManager;
......@@ -55,6 +54,16 @@ class Arguments extends \ArrayObject {