[TASK] Remove @inject from ext:fluid 76/46376/4
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 29 Jan 2016 18:59:15 +0000 (19:59 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 11 Feb 2016 07:50:22 +0000 (08:50 +0100)
Use inject methods instead.

Resolves: #73018
Releases: master, 7.6
Change-Id: I087020bcefaa39984cd040896cbc16b700bf3e81
Reviewed-on: https://review.typo3.org/46376
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
12 files changed:
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php
typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php
typo3/sysext/fluid/Classes/Core/Widget/WidgetRequestHandler.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/TableListViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Be/Widget/PaginateViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormFieldViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Form/AbstractFormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/FormViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/ImageViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/AutocompleteViewHelper.php
typo3/sysext/fluid/Classes/ViewHelpers/Widget/PaginateViewHelper.php

index 5de3718..46ead15 100644 (file)
@@ -49,7 +49,6 @@ class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext
      * the whole syntax tree should be cacheable
      *
      * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
      */
     protected $objectManager;
 
@@ -64,7 +63,6 @@ class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext
      * ViewHelper Variable Container
      *
      * @var \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer
-     * @inject
      */
     protected $viewHelperVariableContainer;
 
@@ -99,6 +97,22 @@ class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext
         LegacyNamespaceExpressionNode::class
     ];
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
+    /**
+     * @param \TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer
+     */
+    public function injectViewHelperVariableContainer(\TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer)
+    {
+        $this->viewHelperVariableContainer = $viewHelperVariableContainer;
+    }
+
     /**
      * @param ViewInterface $view
      */
index 6cc5528..c67d945 100644 (file)
@@ -86,7 +86,6 @@ abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\Abst
 
     /**
      * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
      */
     protected $objectManager;
 
@@ -102,6 +101,14 @@ abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\Abst
         $this->viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
     }
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
     /**
      * Inject a Reflection service
      *
index e0b144f..dbc46d6 100644 (file)
@@ -24,8 +24,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
 {
     /**
      * The Controller associated to this widget.
-     * This needs to be filled by the individual subclass by an @inject
-     * annotation.
+     * This needs to be filled by the individual subclass by an inject method.
      *
      * @var \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetController
      * @api
@@ -52,7 +51,6 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
 
     /**
      * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-     * @inject
      */
     protected $extensionService;
 
@@ -85,6 +83,14 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
         $this->widgetContext = $this->objectManager->get(\TYPO3\CMS\Fluid\Core\Widget\WidgetContext::class);
     }
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
+     */
+    public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService)
+    {
+        $this->extensionService = $extensionService;
+    }
+
     /**
      * Initialize the arguments of the ViewHelper, and call the render() method of the ViewHelper.
      *
index 56783b6..212c681 100644 (file)
@@ -24,22 +24,43 @@ class WidgetRequestHandler extends \TYPO3\CMS\Extbase\Mvc\Web\AbstractRequestHan
 {
     /**
      * @var \TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder
-     * @inject
      */
     protected $ajaxWidgetContextHolder;
 
     /**
      * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     * @inject
      */
     protected $configurationManager;
 
     /**
      * @var \TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder
-     * @inject
      */
     protected $requestBuilder;
 
+    /**
+     * @param \TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder
+     */
+    public function injectAjaxWidgetContextHolder(\TYPO3\CMS\Fluid\Core\Widget\AjaxWidgetContextHolder $ajaxWidgetContextHolder)
+    {
+        $this->ajaxWidgetContextHolder = $ajaxWidgetContextHolder;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+     */
+    public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
+    {
+        $this->configurationManager = $configurationManager;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder $requestBuilder
+     */
+    public function injectWidgetRequestBuilder(\TYPO3\CMS\Fluid\Core\Widget\WidgetRequestBuilder $requestBuilder)
+    {
+        $this->requestBuilder = $requestBuilder;
+    }
+
     /**
      * Handles the web request. The response will automatically be sent to the client.
      *
index 5673181..e40c0ee 100644 (file)
@@ -45,10 +45,17 @@ class TableListViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBacken
 {
     /**
      * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     * @inject
      */
     protected $configurationManager;
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+     */
+    public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
+    {
+        $this->configurationManager = $configurationManager;
+    }
+
     /**
      * Renders a record list as known from the TYPO3 list module
      * Note: This feature is experimental!
index fe920d8..5e54dce 100644 (file)
@@ -49,10 +49,17 @@ class PaginateViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetView
 {
     /**
      * @var \TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController
-     * @inject
      */
     protected $controller;
 
+    /**
+     * @param \TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController $controller
+     */
+    public function injectPaginateController(\TYPO3\CMS\Fluid\ViewHelpers\Be\Widget\Controller\PaginateController $controller)
+    {
+        $this->controller = $controller;
+    }
+
     /**
      * @param \TYPO3\CMS\Extbase\Persistence\QueryResultInterface $objects
      * @param string $as
index 423c900..17f0a6f 100644 (file)
@@ -28,7 +28,6 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
 {
     /**
      * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     * @inject
      */
     protected $configurationManager;
 
@@ -37,6 +36,14 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
      */
     protected $respectSubmittedDataValue = false;
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager
+     */
+    public function injectConfigurationManager(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
+    {
+        $this->configurationManager = $configurationManager;
+    }
+
     /**
      * Initialize arguments.
      *
index 36562b8..ebf6dd7 100644 (file)
@@ -24,10 +24,17 @@ abstract class AbstractFormViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\A
 {
     /**
      * @var \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface
-     * @inject
      */
     protected $persistenceManager;
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager
+     */
+    public function injectPersistenceManager(\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
+    {
+        $this->persistenceManager = $persistenceManager;
+    }
+
     /**
      * Prefixes / namespaces the given name with the form field prefix
      *
index 94ae8be..4d302d5 100644 (file)
@@ -50,19 +50,16 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
 
     /**
      * @var \TYPO3\CMS\Extbase\Security\Cryptography\HashService
-     * @inject
      */
     protected $hashService;
 
     /**
      * @var \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService
-     * @inject
      */
     protected $mvcPropertyMappingConfigurationService;
 
     /**
      * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-     * @inject
      */
     protected $extensionService;
 
@@ -74,6 +71,30 @@ class FormViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormViewH
      */
     protected $formActionUriArguments;
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService
+     */
+    public function injectHashService(\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService)
+    {
+        $this->hashService = $hashService;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService
+     */
+    public function injectMvcPropertyMappingConfigurationService(\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService)
+    {
+        $this->mvcPropertyMappingConfigurationService = $mvcPropertyMappingConfigurationService;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Extbase\Service\ExtensionService $extensionService
+     */
+    public function injectExtensionService(\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService)
+    {
+        $this->extensionService = $extensionService;
+    }
+
     /**
      * Initialize arguments.
      *
index 084977e..d11004c 100644 (file)
@@ -64,10 +64,17 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedV
 
     /**
      * @var \TYPO3\CMS\Extbase\Service\ImageService
-     * @inject
      */
     protected $imageService;
 
+    /**
+     * @param \TYPO3\CMS\Extbase\Service\ImageService $imageService
+     */
+    public function injectImageService(\TYPO3\CMS\Extbase\Service\ImageService $imageService)
+    {
+        $this->imageService = $imageService;
+    }
+
     /**
      * Initialize arguments.
      *
index 43db952..47322a6 100644 (file)
@@ -45,10 +45,17 @@ class AutocompleteViewHelper extends \TYPO3\CMS\Fluid\Core\Widget\AbstractWidget
 
     /**
      * @var \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController
-     * @inject
      */
     protected $controller;
 
+    /**
+     * @param \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller
+     */
+    public function injectAutocompleteController(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\AutocompleteController $controller)
+    {
+        $this->controller = $controller;
+    }
+
     /**
      * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $objects
      * @param string $for
index 3c03c6d..ad69886 100644 (file)
@@ -51,10 +51,17 @@ class PaginateViewHelper extends AbstractWidgetViewHelper
 {
     /**
      * @var \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController
-     * @inject
      */
     protected $controller;
 
+    /**
+     * @param \TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController $controller
+     */
+    public function injectPaginateController(\TYPO3\CMS\Fluid\ViewHelpers\Widget\Controller\PaginateController $controller)
+    {
+        $this->controller = $controller;
+    }
+
     /**
      * @param QueryResultInterface|ObjectStorage|array $objects
      * @param string $as