[TASK] Remove @inject from ext:fluid 04/46604/3
authorWouter Wolters <typo3@wouterwolters.nl>
Fri, 29 Jan 2016 18:59:15 +0000 (19:59 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 12 Feb 2016 10:13:16 +0000 (11:13 +0100)
Use inject methods instead.

Resolves: #73018
Releases: master, 7.6
Change-Id: I087020bcefaa39984cd040896cbc16b700bf3e81
Reviewed-on: https://review.typo3.org/46604
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Markus Sommer <markussom@posteo.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 3802a68..a56d994 100644 (file)
@@ -25,7 +25,6 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
      * the whole syntax tree should be cacheable
      *
      * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
      */
     protected $objectManager;
 
@@ -40,11 +39,26 @@ class RenderingContext implements \TYPO3\CMS\Fluid\Core\Rendering\RenderingConte
      * ViewHelper Variable Container
      *
      * @var \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer
-     * @inject
      */
     protected $viewHelperVariableContainer;
 
     /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
+    /**
+     * @param \TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer
+     */
+    public function injectViewHelperVariableContainer(\TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperVariableContainer $viewHelperVariableContainer)
+    {
+        $this->viewHelperVariableContainer = $viewHelperVariableContainer;
+    }
+
+    /**
      * Returns the object manager. Only the ViewHelperNode should do this.
      *
      * @return \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
index d1b1ad2..94e68c7 100644 (file)
@@ -104,7 +104,6 @@ abstract class AbstractViewHelper
 
     /**
      * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
-     * @inject
      */
     protected $objectManager;
 
@@ -139,6 +138,14 @@ abstract class AbstractViewHelper
     }
 
     /**
+     * @param \TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager
+     */
+    public function injectObjectManager(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
+    {
+        $this->objectManager = $objectManager;
+    }
+
+    /**
      * Inject a Reflection service
      *
      * @param \TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService Reflection service
index 3d39459..e543ad0 100644 (file)
@@ -27,8 +27,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
@@ -55,7 +54,6 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
 
     /**
      * @var \TYPO3\CMS\Extbase\Service\ExtensionService
-     * @inject
      */
     protected $extensionService;
 
@@ -84,6 +82,14 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper
     }
 
     /**
+     * @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.
      *
      * @return string the rendered ViewHelper.
index 76730b5..5c47322 100644 (file)
@@ -30,23 +30,44 @@ 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.
      *
      * @return \TYPO3\CMS\Extbase\Mvc\Web\Response
index c989b15..15e21c1 100644 (file)
@@ -48,11 +48,18 @@ 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 bd87910..03f379d 100644 (file)
@@ -53,11 +53,18 @@ 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
      * @param array $configuration
index 7e8203f..c00878c 100644 (file)
@@ -37,7 +37,6 @@ abstract class AbstractFormFieldViewHelper extends AbstractFormViewHelper
 {
     /**
      * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
-     * @inject
      */
     protected $configurationManager;
 
@@ -47,6 +46,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.
      *
      * @return void
index 3c192fb..792c950 100644 (file)
@@ -21,11 +21,18 @@ 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
      *
      * @param string $fieldName field name to be prefixed
index 434ff97..818384e 100644 (file)
@@ -56,19 +56,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;
 
@@ -81,6 +78,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.
      *
      * @return void
index 78a12f4..bf1a9f3 100644 (file)
@@ -64,11 +64,18 @@ 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.
      *
      * @return void
index 8dac1c8..b812553 100644 (file)
@@ -51,11 +51,18 @@ 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
      * @param string $searchProperty
index 73307cb..fa83395 100644 (file)
@@ -58,11 +58,18 @@ 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
      * @param array $configuration