[TASK] Use @TYPO3\CMS\Extbase\Annotation\ORM\Cascade in core extensions 13/55313/4
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Tue, 9 Jan 2018 19:55:39 +0000 (20:55 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 14 Jan 2018 12:41:43 +0000 (13:41 +0100)
Releases: master
Resolves: #83521
Change-Id: I8bd477ccf2ae6fca478b758cf61654a1bec388cd
Reviewed-on: https://review.typo3.org/55313
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Build/Scripts/annotationChecker.php
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Blog.php
typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Post.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyClassWithAllTypesOfProperties.php

index 3e39690..5a48744 100755 (executable)
@@ -61,9 +61,10 @@ class NodeVisitor extends NodeVisitorAbstract
                     // PHPCheckStyle
                     'SuppressWarnings', 'noinspection',
                     // Extbase related (deprecated)
-                    'inject', 'transient', 'validate', 'cascade', 'cli', 'flushesCaches',
+                    'inject', 'transient', 'validate', 'cli', 'flushesCaches',
                     // Extbase related
-                    'Extbase\\\\Inject', 'Inject', 'Transient', 'Extbase\\\\ORM\\\\Lazy', 'Cascade', 'IgnoreValidation', 'Enum',
+                    'Extbase\\\\Inject', 'Inject', 'Transient', 'Extbase\\\\ORM\\\\Lazy', 'IgnoreValidation', 'Enum',
+                    'TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\ORM\\\\Cascade', 'Extbase\\\\ORM\\\\Cascade', 'Cascade',
                     // Extension scanner
                     'extensionScannerIgnoreFile', 'extensionScannerIgnoreLine'
                 ];
@@ -94,8 +95,8 @@ $finder = new Symfony\Component\Finder\Finder();
 $finder->files()
     ->in(__DIR__ . '/../../typo3/')
     ->name('/\.php$/')
-    // black list a unit test file that tests old deprecations
-    ->notName('DummyClassWithLazyProperty.php')
+    // black list some deprecated unit test fixture files that test old deprecations
+    ->notPath('/.*sysext\/extbase\/Tests\/UnitDeprecated\/Reflection\/Fixture/')
 ;
 
 $output = new ConsoleOutput();
index e78954e..a6020c5 100644 (file)
@@ -436,9 +436,10 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
     }
 
     /**
-     * Persists an object storage. Objects of a 1:n or m:n relation are queued and processed with the parent object. A 1:1 relation
-     * gets persisted immediately. Objects which were removed from the property were detached from the parent object. They will not be
-     * deleted by default. You have to annotate the property with "@cascade remove" if you want them to be deleted as well.
+     * Persists an object storage. Objects of a 1:n or m:n relation are queued and processed with the parent object.
+     * A 1:1 relation gets persisted immediately. Objects which were removed from the property were detached from
+     * the parent object. They will not be deleted by default. You have to annotate the property
+     * with '@TYPO3\CMS\Extbase\Annotation\ORM\Cascade("remove")' if you want them to be deleted as well.
      *
      * @param \TYPO3\CMS\Extbase\Persistence\ObjectStorage $objectStorage The object storage to be persisted.
      * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $parentObject The parent object. One of the properties holds the object storage.
index 8c3f8c2..bdc99ce 100644 (file)
@@ -56,7 +56,7 @@ class Blog extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
      *
      * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ExtbaseTeam\BlogExample\Domain\Model\Post>
      * @Extbase\ORM\Lazy
-     * @cascade remove
+     * @Extbase\ORM\Cascade("remove")
      */
     protected $posts = null;
 
index 17a90d6..d625f1f 100644 (file)
@@ -66,7 +66,7 @@ class Post extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
     /**
      * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\ExtbaseTeam\BlogExample\Domain\Model\Comment>
      * @Extbase\ORM\Lazy
-     * @cascade remove
+     * @Extbase\ORM\Cascade("remove")
      */
     protected $comments = null;
 
index 459e197..e29a643 100644 (file)
@@ -14,8 +14,8 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Reflection\Fixture;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Extbase\Annotation as Extbase;
 use TYPO3\CMS\Extbase\Annotation\Inject;
-use TYPO3\CMS\Extbase\Annotation\ORM\Cascade;
 use TYPO3\CMS\Extbase\Annotation\ORM\Transient;
 
 /**
@@ -58,12 +58,12 @@ class DummyClassWithAllTypesOfProperties
 
     /**
      * @var DummyClassWithAllTypesOfProperties
-     * @Cascade("remove")
+     * @Extbase\ORM\Cascade("remove")
      */
     public $propertyWithCascadeAnnotation;
 
     /**
-     * @Cascade("remove")
+     * @Extbase\ORM\Cascade("remove")
      */
     public $propertyWithCascadeAnnotationWithoutVarAnnotation;