[!!!][TASK] Drop evaluation of @inject annotations 82/58882/6
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Sat, 10 Nov 2018 14:47:35 +0000 (15:47 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 20 Dec 2018 12:53:26 +0000 (13:53 +0100)
@inject will no longer trigger dependency injection

Releases: master
Resolves: #86899
Change-Id: Id440e94b71f62e7b2c396ec1c865ebd109026a04
Reviewed-on: https://review.typo3.org/58882
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/extbase/Tests/UnitDeprecated/Reflection/ClassSchemaTest.php
typo3/sysext/extbase/Tests/UnitDeprecated/Reflection/Fixture/DummyClassWithInjectProperty.php [deleted file]
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyAnnotationMatcher.php

index 0f40732..f1925f6 100644 (file)
@@ -287,37 +287,6 @@ class ClassSchema
                 }
             }
 
-            if ($propertyName !== 'settings' && $docCommentParser->isTaggedWith('inject')) {
-                trigger_error(
-                    sprintf(
-                        'Property %s::%s is tagged with @inject which is deprecated and will be removed in TYPO3 v10.0.',
-                        $reflectionClass->getName(),
-                        $reflectionProperty->getName()
-                    ),
-                    E_USER_DEPRECATED
-                );
-                try {
-                    $varValues = $docCommentParser->getTagValues('var');
-                    $this->properties[$propertyName]['annotations']['inject'] = true;
-                    $this->properties[$propertyName]['annotations']['type'] = ltrim($varValues[0], '\\');
-                    $this->properties[$propertyName]['annotations']['dependency'] = ltrim($varValues[0], '\\');
-
-                    if (!$reflectionProperty->isPublic()) {
-                        trigger_error(
-                            sprintf(
-                                'Property %s::%s is not public and tagged with @inject which is deprecated and will stop working in TYPO3 v10.0.',
-                                $reflectionClass->getName(),
-                                $reflectionProperty->getName()
-                            ),
-                            E_USER_DEPRECATED
-                        );
-                    }
-
-                    $this->injectProperties[] = $propertyName;
-                } catch (\Exception $e) {
-                }
-            }
-
             if ($docCommentParser->isTaggedWith('var') && !$docCommentParser->isTaggedWith('transient')) {
                 try {
                     $cascadeAnnotationValues = $docCommentParser->getTagValues('cascade');
index 31bb0ab..1ca3911 100644 (file)
@@ -31,18 +31,6 @@ class ClassSchemaTest extends UnitTestCase
      */
     protected $resetSingletonInstances = true;
 
-    public function testClassSchemaDetectsInjectProperties()
-    {
-        $classSchema = new ClassSchema(Fixture\DummyClassWithInjectProperty::class);
-        static::assertTrue($classSchema->hasInjectProperties());
-
-        $propertyDefinition = $classSchema->getProperty('propertyWithInjectAnnotation');
-        static::assertTrue($propertyDefinition['annotations']['inject']);
-
-        $injectProperties = $classSchema->getInjectProperties();
-        static::assertArrayHasKey('propertyWithInjectAnnotation', $injectProperties);
-    }
-
     public function testClassSchemaDetectsLazyProperties()
     {
         $classSchema = new ClassSchema(Fixture\DummyClassWithLazyProperty::class);
diff --git a/typo3/sysext/extbase/Tests/UnitDeprecated/Reflection/Fixture/DummyClassWithInjectProperty.php b/typo3/sysext/extbase/Tests/UnitDeprecated/Reflection/Fixture/DummyClassWithInjectProperty.php
deleted file mode 100644 (file)
index 23887b2..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\UnitDeprecated\Reflection\Fixture;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-/**
- * Fixture class with getters and setters
- */
-class DummyClassWithInjectProperty
-{
-    /**
-     * @inject
-     * @var DummyClassWithInjectProperty
-     */
-    public $propertyWithInjectAnnotation;
-}
index 5aed43b..fbd43e1 100644 (file)
@@ -5,6 +5,7 @@ return [
             'Feature-82869-ReplaceInjectWithTYPO3CMSExtbaseAnnotationInject.rst',
             'Deprecation-82869-ReplaceInjectWithTYPO3CMSExtbaseAnnotationInject.rst',
             'Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     '@lazy' => [