[!!!][TASK] Drop evaluation of @cascade annotations 85/58885/6
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Sat, 10 Nov 2018 15:14:40 +0000 (16:14 +0100)
committerBenni Mack <benni@typo3.org>
Thu, 20 Dec 2018 15:27:04 +0000 (16:27 +0100)
@cascade will no longer trigger cascading of actions in the
persistence layer

Releases: master
Resolves: #86906
Change-Id: I714ae2ad2050e2ebf87a5918a4bd35661bc43d48
Reviewed-on: https://review.typo3.org/58885
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
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/DummyClassWithAllTypesOfProperties.php
typo3/sysext/extbase/Tests/UnitDeprecated/Reflection/ReflectionServiceTest.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/PropertyAnnotationMatcher.php

index f1925f6..663fa29 100644 (file)
@@ -288,23 +288,6 @@ class ClassSchema
             }
 
             if ($docCommentParser->isTaggedWith('var') && !$docCommentParser->isTaggedWith('transient')) {
-                try {
-                    $cascadeAnnotationValues = $docCommentParser->getTagValues('cascade');
-                    $this->properties[$propertyName]['annotations']['cascade'] = $cascadeAnnotationValues[0];
-                } catch (\Exception $e) {
-                }
-
-                if ($this->properties[$propertyName]['annotations']['cascade'] !== null) {
-                    trigger_error(
-                        sprintf(
-                            'Property %s::%s is tagged with @cascade which is deprecated and will be removed in TYPO3 v10.0.',
-                            $reflectionClass->getName(),
-                            $reflectionProperty->getName()
-                        ),
-                        E_USER_DEPRECATED
-                    );
-                }
-
                 if (($annotation = $annotationReader->getPropertyAnnotation($reflectionProperty, Cascade::class)) instanceof Cascade) {
                     /** @var Cascade $annotation */
                     $this->properties[$propertyName]['annotations']['cascade'] = $annotation->value;
index 1ca3911..49a5af8 100644 (file)
@@ -37,22 +37,6 @@ class ClassSchemaTest extends UnitTestCase
         static::assertTrue($classSchema->getProperty('propertyWithLazyAnnotation')['annotations']['lazy']);
     }
 
-    public function testClassSchemaDetectsCascadeProperty()
-    {
-        $classSchema = new ClassSchema(Fixture\DummyClassWithAllTypesOfProperties::class);
-
-        $propertyDefinition = $classSchema->getProperty('propertyWithCascadeAnnotation');
-        static::assertSame('remove', $propertyDefinition['annotations']['cascade']);
-    }
-
-    public function testClassSchemaDetectsCascadePropertyOnlyWithVarAnnotation()
-    {
-        $classSchema = new ClassSchema(Fixture\DummyClassWithAllTypesOfProperties::class);
-
-        $propertyDefinition = $classSchema->getProperty('propertyWithCascadeAnnotationWithoutVarAnnotation');
-        static::assertNull($propertyDefinition['annotations']['cascade']);
-    }
-
     public function testClassSchemaDetectsIgnoreValidationAnnotation()
     {
         $classSchema = new ClassSchema(Fixture\DummyControllerWithIgnorevalidationAnnotation::class);
index 1766cc0..a6729b5 100644 (file)
@@ -53,17 +53,6 @@ class DummyClassWithAllTypesOfProperties
     public $propertyWithTransientAnnotation;
 
     /**
-     * @var DummyClassWithAllTypesOfProperties
-     * @cascade remove
-     */
-    public $propertyWithCascadeAnnotation;
-
-    /**
-     * @cascade remove
-     */
-    public $propertyWithCascadeAnnotationWithoutVarAnnotation;
-
-    /**
      * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture\DummyClassWithAllTypesOfProperties>
      */
     public $propertyWithObjectStorageAnnotation;
index acd0473..8494e3c 100644 (file)
@@ -311,8 +311,6 @@ class ReflectionServiceTest extends UnitTestCase
                 'propertyWithIgnoredTags',
                 'propertyWithInjectAnnotation',
                 'propertyWithTransientAnnotation',
-                'propertyWithCascadeAnnotation',
-                'propertyWithCascadeAnnotationWithoutVarAnnotation',
                 'propertyWithObjectStorageAnnotation'
             ],
             $service->getClassPropertyNames(Fixture\DummyClassWithAllTypesOfProperties::class)
index fbd43e1..50c9d02 100644 (file)
@@ -24,6 +24,7 @@ return [
         'restFiles' => [
             'Feature-83093-ReplaceCascadeWithTYPO3CMSExtbaseAnnotationORMCascade.rst',
             'Deprecation-83093-ReplaceCascadeWithTYPO3CMSExtbaseAnnotationORMCascade.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     '@validate' => [