Revert "[FEATURE] Support @Flow\Inject annotations in Extbase" 97/21997/2
authorMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 6 Jul 2013 10:56:30 +0000 (12:56 +0200)
committerMarc Bastian Heinrichs <typo3@mbh-software.de>
Sat, 6 Jul 2013 11:24:29 +0000 (13:24 +0200)
This reverts commit 09bc492925713036cef679c92ffc28eda941605c

We should not support this annotation in extbase, because it
has no benefit and breaks with the annotation concept in
Flow. "Flow" is only an alias for "TYPO3\Flow\Annotations" in
Flow and needs to be registered by "use TYPO3\Flow\Annotations as Flow".

Change-Id: Ic0ecdc58754c176b1140db463c2405cb47bf9933
Reviewed-on: https://review.typo3.org/21997
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php
typo3/sysext/extbase/Tests/Fixture/ClassWithInjectProperties.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ClassInfoFactoryTest.php

index 69f51f9..9f5b8e7 100644 (file)
@@ -123,7 +123,7 @@ class ClassInfoFactory {
                if (is_array($reflectionProperties)) {
                        foreach ($reflectionProperties as $reflectionProperty) {
                                $reflectedProperty = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Reflection\\PropertyReflection', $reflectedClass->getName(), $reflectionProperty->getName());
-                               if (($reflectedProperty->isTaggedWith('inject') || $reflectedProperty->isTaggedWith('Flow\Inject')) && $reflectedProperty->getName() !== 'settings') {
+                               if ($reflectedProperty->isTaggedWith('inject') && $reflectedProperty->getName() !== 'settings') {
                                        $varValues = $reflectedProperty->getTagValues('var');
                                        if (count($varValues) == 1) {
                                                $result[$reflectedProperty->getName()] = ltrim($varValues[0], '\\');
index fb4076e..b4f0a4d 100644 (file)
@@ -39,12 +39,6 @@ class ClassWithInjectProperties {
         * @inject
         */
        protected $secondDummyClass;
-
-       /**
-        * @var \TYPO3\CMS\Extbase\Tests\Fixture\SecondDummyClass
-        * @Flow\Inject
-        */
-       protected $secondDummyClassWithFlowInject;
 }
 
 ?>
\ No newline at end of file
index 31ad1c6..ac6d1a6 100644 (file)
@@ -66,13 +66,7 @@ class ClassInfoFactoryTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
         */
        public function buildClassInfoDetectsPropertiesToInjectByAnnotation() {
                $classInfo = $this->classInfoFactory->buildClassInfoFromClassName('TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ClassWithInjectProperties');
-               $this->assertEquals(
-                       array(
-                               'secondDummyClass' => 'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\SecondDummyClass',
-                               'secondDummyClassWithFlowInject' => 'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\SecondDummyClass'
-                       ),
-                       $classInfo->getInjectProperties()
-               );
+               $this->assertEquals(array('secondDummyClass' => 'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\SecondDummyClass'), $classInfo->getInjectProperties());
        }
 
        /**