[TASK] Deprecate extbase annotation @flushesCaches 28/58328/3
authorAnja <aleichsenring@ab-softlab.de>
Wed, 19 Sep 2018 07:18:07 +0000 (09:18 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 20 Sep 2018 10:38:17 +0000 (12:38 +0200)
The annotation has been introduced during backport from FLOW, but
was never implemented to do anything useful. It will be removed
without substitution.

Change-Id: I34e337ecfd81185a965beb4d2495256ba6b35670
Resolves: #85981
Releases: master
Related: #82703
Reviewed-on: https://review.typo3.org/58328
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Build/Scripts/annotationChecker.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85981-AnnotationFlushesCaches.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Mvc/Cli/Command.php
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php

index cc664eb..a4144ba 100755 (executable)
@@ -65,7 +65,7 @@ class NodeVisitor extends NodeVisitorAbstract
                     // Extbase related (deprecated), will be removed in TYPO3 v10.0
                     'transient',
                     'cli', // this is still used in Extbase\Tests\UnitDeprecated
-                    'flushesCaches',
+                    'flushesCaches', // still used in MockCCommandController test fixture, will be removed in TYPO3 v10.0
                     // Extbase related
                     'TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\Inject', 'Extbase\\\\Inject', 'Inject',
                     'TYPO3\\\\CMS\\\\Extbase\\\\Annotation\\\\Validate', 'Extbase\\\\Validate', 'Validate',
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85981-AnnotationFlushesCaches.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85981-AnnotationFlushesCaches.rst
new file mode 100644 (file)
index 0000000..6e0d85f
--- /dev/null
@@ -0,0 +1,39 @@
+
+.. include:: ../../Includes.txt
+
+===============================================
+Deprecation: #83094 - Annotation @flushesCaches
+===============================================
+
+See :issue:`85981`
+
+Description
+===========
+
+The `@flushesCaches` annotation has been marked as deprecated and will be removed with TYPO3 v10.
+The annotation was introduced during backport from FLOW and never implemented to actually do anything
+useful. It will be removed without substitution.
+
+With it, the method :php:`TYPO3\CMS\Extbase\Mvc\Cli\Command->isFlushingCaches()` has been marked as deprecated
+and will also be removed in TYPO3 v10.
+
+
+Impact
+======
+
+Usage of Annotation `@flushesCaches` and method :php:`TYPO3\CMS\Extbase\Mvc\Cli\Command->isFlushingCaches()`
+will trigger a PHP :php:`E_USER_DEPRECATED` error.
+
+
+Affected Installations
+======================
+
+All extensions that use `@flushesCaches` or call the method :php:`TYPO3\CMS\Extbase\Mvc\Cli\Command->isFlushingCaches()`.
+
+
+Migration
+=========
+
+Just remove annotation and method call. They did not do anything before.
+
+.. index:: PHP-API, ext:extbase, FullyScanned
index a24099c..fcdcc34 100644 (file)
@@ -256,9 +256,15 @@ class Command
      * Note that neither this method nor the @flushesCaches annotation is currently part of the official API.
      *
      * @return bool
+     *
+     * @deprecated will be removed in TYPO3 v10.
      */
     public function isFlushingCaches()
     {
+        trigger_error(
+            'Method isFlushingCaches() will be removed in v10. Do not call from other extension.',
+            E_USER_DEPRECATED
+        );
         return isset($this->classSchema->getMethod($this->controllerCommandMethod)['tags']['flushesCaches']);
     }
 
index 3ce0e01..aa3b803 100644 (file)
@@ -444,6 +444,16 @@ class ClassSchema
                         E_USER_DEPRECATED
                     );
                 }
+                if ($tag === 'flushesCaches') {
+                    trigger_error(
+                        sprintf(
+                            'Method %s::%s is tagged with @flushesCaches which is deprecated and will be removed in TYPO3 v10.0.',
+                            $reflectionClass->getName(),
+                            $reflectionMethod->getName()
+                        ),
+                        E_USER_DEPRECATED
+                    );
+                }
                 if ($tag === 'validate' && $this->isController && $this->methods[$methodName]['isAction']) {
                     trigger_error(
                         sprintf(
index 080dda0..9f92e36 100644 (file)
@@ -3432,4 +3432,11 @@ return [
             'Deprecation-86288-FrontendBackendUserAuthenticationMethods.rst'
         ],
     ],
+    'TYPO3\CMS\Extbase\Mvc\Cli\Command->isFlushingCaches' => [
+        'numberOfMandatoryArguments' => 0,
+        'maximumNumberOfArguments' => 0,
+        'restFiles' => [
+            'Deprecation-85981-AnnotationFlushesCaches.rst'
+        ],
+    ],
 ];