[TASK] Use @TYPO3\CMS\Extbase\Annotation\Inject in core extensions 14/55314/4
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Tue, 9 Jan 2018 20:05:01 +0000 (21:05 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Jan 2018 13:04:00 +0000 (14:04 +0100)
Releases: master
Resolves: #83522
Change-Id: Ie1f9db6e3180c1d32e3d8b99e37ff88669ede86d
Reviewed-on: https://review.typo3.org/55314
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
12 files changed:
Build/Scripts/annotationChecker.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/AbstractController.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/ContentController.php
typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial/Classes/Controller/QueueController.php
typo3/sysext/extbase/Tests/Fixture/ClassWithInjectProperties.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Controller/BlogController.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Controller/ContentController.php
typo3/sysext/extbase/Tests/Unit/Object/Container/Fixtures/ContainerPropertyInjectionTestClasses.php
typo3/sysext/extbase/Tests/Unit/Object/Container/Fixtures/Testclasses.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithAllTypesOfProperties.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithInjectDoctrineAnnotation.php
typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php

index 5a48744..c99caff 100755 (executable)
@@ -61,9 +61,10 @@ class NodeVisitor extends NodeVisitorAbstract
                     // PHPCheckStyle
                     'SuppressWarnings', 'noinspection',
                     // Extbase related (deprecated)
-                    'inject', 'transient', 'validate', 'cli', 'flushesCaches',
+                    'transient', 'validate', 'cli', 'flushesCaches',
                     // Extbase related
-                    'Extbase\\\\Inject', 'Inject', 'Transient', 'Extbase\\\\ORM\\\\Lazy', 'IgnoreValidation', 'Enum',
+                    'TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\Inject', 'Extbase\\\\Inject', 'Inject',
+                    'Transient', 'Extbase\\\\ORM\\\\Lazy', 'IgnoreValidation', 'Enum',
                     'TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade', 'Extbase\\\\ORM\\\\Cascade', 'Cascade',
                     // Extension scanner
                     'extensionScannerIgnoreFile', 'extensionScannerIgnoreLine'
@@ -97,6 +98,9 @@ $finder->files()
     ->name('/\.php$/')
     // black list some deprecated unit test fixture files that test old deprecations
     ->notPath('/.*sysext\/extbase\/Tests\/UnitDeprecated\/Reflection\/Fixture/')
+    // black list some unit test fixture files from extension scanner that test matchers of old annotations
+    ->notName('MethodAnnotationMatcherFixture.php')
+    ->notName('PropertyAnnotationMatcherFixture.php')
 ;
 
 $output = new ConsoleOutput();
index a1c79ff..d23c377 100644 (file)
@@ -14,13 +14,15 @@ namespace OliverHader\IrreTutorial\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  * ContentController
  */
 abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 {
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
      */
     protected $dataMapFactory;
index 3c8aca3..c1384aa 100644 (file)
@@ -14,13 +14,15 @@ namespace OliverHader\IrreTutorial\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  * ContentController
  */
 class ContentController extends AbstractController
 {
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \OliverHader\IrreTutorial\Domain\Repository\ContentRepository
      */
     protected $contentRepository;
index e4ccfeb..fa11229 100644 (file)
@@ -14,13 +14,15 @@ namespace OliverHader\IrreTutorial\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  * ContentController
  */
 class QueueController extends AbstractController
 {
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \OliverHader\IrreTutorial\Domain\Repository\ContentRepository
      */
     protected $contentRepository;
index 2f1779e..c46a99e 100644 (file)
@@ -14,6 +14,8 @@ namespace TYPO3\CMS\Extbase\Tests\Fixture;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  */
 class ClassWithInjectProperties
@@ -25,7 +27,7 @@ class ClassWithInjectProperties
 
     /**
      * @var \TYPO3\CMS\Extbase\Tests\Fixture\SecondDummyClass
-     * @inject
+     * @Extbase\Inject
      */
     protected $secondDummyClass;
 }
index f71789d..a67538b 100644 (file)
@@ -15,13 +15,15 @@ namespace ExtbaseTeam\BlogExample\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  * BlogController
  */
 class BlogController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 {
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \ExtbaseTeam\BlogExample\Domain\Repository\BlogRepository
      */
     protected $blogRepository;
@@ -32,7 +34,7 @@ class BlogController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
     protected $defaultViewObjectName = \TYPO3\CMS\Extbase\Mvc\View\JsonView::class;
 
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
      */
     protected $dataMapFactory;
index e50311b..bad9311 100644 (file)
@@ -16,13 +16,15 @@ namespace ExtbaseTeam\BlogExample\Controller;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
+
 /**
  * ContentController
  */
 class ContentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
 {
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \ExtbaseTeam\BlogExample\Domain\Repository\TtContentRepository
      */
     protected $contentRepository;
@@ -33,7 +35,7 @@ class ContentController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControll
     protected $defaultViewObjectName = \TYPO3\CMS\Extbase\Mvc\View\JsonView::class;
 
     /**
-     * @inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapFactory
      */
     protected $dataMapFactory;
index 0dcb50d..3e53249 100644 (file)
@@ -3,12 +3,12 @@ declare(strict_types = 1);
 
 namespace TYPO3\CMS\Extbase\Tests\Unit\Object\Container\Fixtures;
 
-use TYPO3\CMS\Extbase\Annotation\Inject;
+use TYPO3\CMS\Extbase\Annotation as Extbase;
 
 class PublicPropertyInjectClass
 {
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Tests\Unit\Object\Container\Fixtures\ArgumentTestClassForPublicPropertyInjection
      */
     public $foo;
@@ -22,7 +22,7 @@ class ProtectedPropertyInjectClass
 {
 
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Tests\Unit\Object\Container\Fixtures\ArgumentTestClassForPublicPropertyInjection
      */
     protected $foo;
index 7d8ac22..8500bfb 100644 (file)
@@ -288,7 +288,7 @@ class t3lib_object_tests_injectmethods
     }
 
     /**
-     * @inject
+     * @TYPO3\CMS\Extbase\Annotation\Inject
      * @param \t3lib_object_tests_b_child $o
      */
     public function setClassBChild(\t3lib_object_tests_b_child $o)
index e29a643..0593f4b 100644 (file)
@@ -15,7 +15,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture;
  */
 
 use TYPO3\CMS\Extbase\Annotation as Extbase;
-use TYPO3\CMS\Extbase\Annotation\Inject;
 use TYPO3\CMS\Extbase\Annotation\ORM\Transient;
 
 /**
@@ -46,7 +45,7 @@ class DummyClassWithAllTypesOfProperties
     public $propertyWithIgnoredTags;
 
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var DummyClassWithAllTypesOfProperties
      */
     public $propertyWithInjectAnnotation;
index 43cd3c4..729ffb7 100644 (file)
@@ -16,7 +16,7 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Extbase\Annotation\Inject;
+use TYPO3\CMS\Extbase\Annotation as Extbase;
 use TYPO3\CMS\Extbase\Tests\Unit\Reflection\ClassSchemaTest;
 use TYPO3\CMS\Extbase\Tests\Unit\Reflection\ClassSchemaTest as AliasedClassSchemaTest;
 
@@ -26,25 +26,25 @@ use TYPO3\CMS\Extbase\Tests\Unit\Reflection\ClassSchemaTest as AliasedClassSchem
 class DummyClassWithInjectDoctrineAnnotation
 {
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var \TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyClassWithInjectDoctrineAnnotation
      */
     public $propertyWithFullQualifiedClassName;
 
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var DummyClassWithInjectDoctrineAnnotation
      */
     public $propertyWithRelativeClassName;
 
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var ClassSchemaTest
      */
     public $propertyWithImportedClassName;
 
     /**
-     * @Inject
+     * @Extbase\Inject
      * @var AliasedClassSchemaTest
      */
     public $propertyWithImportedAndAliasedClassName;
index 04838fb..ae29c61 100644 (file)
@@ -213,7 +213,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
         $this->assertTrue($service->isPropertyTaggedWith(
             Fixture\DummyClassWithAllTypesOfProperties::class,
             'propertyWithInjectAnnotation',
-            'inject'
+            'extbase\inject'
         ));
 
         $this->assertFalse($service->isPropertyTaggedWith(
@@ -231,7 +231,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
         $this->assertFalse($service->isPropertyTaggedWith(
             'NonExistantNamespace\\NonExistantClass',
             'propertyWithInjectAnnotation',
-            'inject'
+            'extbase\inject'
         ));
     }
 
@@ -262,7 +262,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
         $service = new ReflectionService();
         $this->assertSame(
             [
-                'inject' => [],
+                'extbase\inject' => [],
                 'var' => [
                     'DummyClassWithAllTypesOfProperties'
                 ]