Revert "[TASK] Deprecate @cli annotation" 44/58044/2
authorMathias Brodala <mbrodala@pagemachine.de>
Mon, 27 Aug 2018 09:11:52 +0000 (11:11 +0200)
committerBenni Mack <benni@typo3.org>
Mon, 27 Aug 2018 11:42:55 +0000 (13:42 +0200)
We do not have a replacement for TYPO3v9 so we cannot deprecate this annotation yet.

This reverts commit c7791b01fe420cd8ed7298635ba414d1b5ea2638.

Change-Id: Ie7228d6e13a5647698f2a5c26ebe9fd56de80aac
Resolves: #85988
Related: #85977
Reviewed-on: https://review.typo3.org/58044
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Build/Scripts/annotationChecker.php
typo3/sysext/core/Documentation/Changelog/master/Deprecation-85977-DeprecateCliAnnotation.rst [deleted file]
typo3/sysext/extbase/Classes/Command/HelpCommandController.php
typo3/sysext/extbase/Classes/Mvc/Cli/Command.php
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/CommandTest.php
typo3/sysext/extbase/Tests/Unit/Mvc/Cli/Fixture/Command/MockCCommandController.php
typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/CommandTest.php [deleted file]
typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/Fixture/Command/MockCCommandController.php [deleted file]
typo3/sysext/extensionmanager/Classes/Command/ExtensionCommandController.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodAnnotationMatcher.php

index cc664eb..4e89a94 100755 (executable)
@@ -62,10 +62,8 @@ class NodeVisitor extends NodeVisitorAbstract
                     'env',
                     // PHPCheckStyle
                     'SuppressWarnings', 'noinspection',
-                    // Extbase related (deprecated), will be removed in TYPO3 v10.0
-                    'transient',
-                    'cli', // this is still used in Extbase\Tests\UnitDeprecated
-                    'flushesCaches',
+                    // Extbase related (deprecated)
+                    'transient', 'cli', 'flushesCaches',
                     // 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-85977-DeprecateCliAnnotation.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-85977-DeprecateCliAnnotation.rst
deleted file mode 100644 (file)
index 271d3b0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-.. include:: ../../Includes.txt
-
-===============================================
-Deprecation: #85977 - Deprecate @cli annotation
-===============================================
-
-See :issue:`85977`
-
-Description
-===========
-
-Back then, the PHPDoc annotation `@cli` was added to indicate Extbase CommandController commands to be usable on CLI only instead of also be usable as a scheduler task.
-
-The scheduler implementation will be refactored in TYPO3 10 and the execution of commands from the backend will vanish. Therefore it will not be necessary any more to define if commands can only be used on the command line or not. In the future, all commands will only be executable from the command line.
-
-
-Impact
-======
-
-Using @cli will log a deprecation warning.
-Once removed from your commands, they will appear in the list of executable executable commands in the scheduler module.
-
-
-Affected Installations
-======================
-
-All installations that make use of command controllers that are tagged with @cli.
-
-
-Migration
-=========
-
-There is none.
-
-.. index:: FullyScanned, ext:scheduler
index 993a246..cf0216b 100644 (file)
@@ -63,6 +63,7 @@ class HelpCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandCon
      * ./typo3/sysext/core/bin/typo3 extbase:help <command identifier>
      *
      * @param string $commandIdentifier Identifier of a command for more details
+     * @cli
      */
     public function helpCommand($commandIdentifier = null)
     {
index c9c5400..974d69d 100644 (file)
@@ -243,8 +243,6 @@ class Command
      * Tells if this command is meant to be used on CLI only.
      *
      * @return bool
-     *
-     * todo: deprecate/remove method in TYPO3 10.x while refactoring the scheduler implementation
      */
     public function isCliOnly()
     {
index f5b16e5..48bd7a3 100644 (file)
@@ -414,16 +414,6 @@ class ClassSchema
             }
 
             foreach ($docCommentParser->getTagsValues() as $tag => $values) {
-                if ($tag === 'cli') {
-                    trigger_error(
-                        sprintf(
-                            'Method %s::%s is tagged with @cli which is deprecated and will be removed in TYPO3 v10.0.',
-                            $reflectionClass->getName(),
-                            $reflectionMethod->getName()
-                        ),
-                        E_USER_DEPRECATED
-                    );
-                }
                 if ($tag === 'ignorevalidation') {
                     trigger_error(
                         sprintf(
index ddaee20..a3536f3 100644 (file)
@@ -107,6 +107,25 @@ class CommandTest extends UnitTestCase
         static::assertTrue($commandController->isInternal());
     }
 
+    public function testIsCliOnly()
+    {
+        $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
+            Command::class,
+            MockCCommandController::class,
+            'empty'
+        );
+
+        static::assertFalse($commandController->isCliOnly());
+
+        $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
+            Command::class,
+            MockCCommandController::class,
+            'cliOnly'
+        );
+
+        static::assertTrue($commandController->isCliOnly());
+    }
+
     public function testIsFlushinCaches()
     {
         $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
index b2c17c2..463c0b4 100644 (file)
@@ -18,6 +18,13 @@ class MockCCommandController extends \TYPO3\CMS\Extbase\Mvc\Cli\Command
     }
 
     /**
+     * @cli
+     */
+    public function cliOnlyCommand()
+    {
+    }
+
+    /**
      * @flushesCaches
      */
     public function flushingCachesCommand()
diff --git a/typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/CommandTest.php b/typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/CommandTest.php
deleted file mode 100644 (file)
index c4d0173..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-namespace TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Cli;
-
-/*
- * 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!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Mvc\Cli\Command;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Cli\Fixture\Command\MockCCommandController;
-use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
-
-/**
- * Test case
- */
-class CommandTest extends UnitTestCase
-{
-    /**
-     * @var bool Reset singletons created by subject
-     */
-    protected $resetSingletonInstances = true;
-
-    public function testIsCliOnly()
-    {
-        $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
-            Command::class,
-            MockCCommandController::class,
-            'empty'
-        );
-
-        static::assertFalse($commandController->isCliOnly());
-
-        $commandController = GeneralUtility::makeInstance(ObjectManager::class)->get(
-            Command::class,
-            MockCCommandController::class,
-            'cliOnly'
-        );
-
-        static::assertTrue($commandController->isCliOnly());
-    }
-}
diff --git a/typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/Fixture/Command/MockCCommandController.php b/typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Cli/Fixture/Command/MockCCommandController.php
deleted file mode 100644 (file)
index d27b835..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-declare(strict_types = 1);
-
-/*
- * 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!
- */
-
-namespace TYPO3\CMS\Extbase\Tests\UnitDeprecated\Mvc\Cli\Fixture\Command;
-
-/**
- * Another mock CLI Command
- */
-class MockCCommandController extends \TYPO3\CMS\Extbase\Mvc\Cli\Command
-{
-    /**
-     * @cli
-     */
-    public function cliOnlyCommand()
-    {
-    }
-}
index 72dbf9a..b972138 100644 (file)
@@ -48,6 +48,7 @@ class ExtensionCommandController extends CommandController
      * recognised extension folder paths in TYPO3.
      *
      * @param string $extensionKey
+     * @cli
      */
     public function installCommand($extensionKey)
     {
@@ -65,6 +66,7 @@ class ExtensionCommandController extends CommandController
      * recognised extension folder paths in TYPO3.
      *
      * @param string $extensionKey
+     * @cli
      */
     public function uninstallCommand($extensionKey)
     {
@@ -78,6 +80,8 @@ class ExtensionCommandController extends CommandController
      *
      * This command is only needed during development. The extension manager takes care
      * creating or updating this info properly during extension (de-)activation.
+     *
+     * @cli
      */
     public function dumpClassLoadingInformationCommand()
     {
index b2d056f..3aafed7 100644 (file)
@@ -6,9 +6,4 @@ return [
             'Deprecation-83094-ReplaceIgnorevalidationWithTYPO3CMSExtbaseAnnotationIgnoreValidation.rst',
         ],
     ],
-    '@cli' => [
-        'restFiles' => [
-            'Deprecation-85977-DeprecateCliAnnotation.rst',
-        ],
-    ],
 ];