From fda08488bf5ecbbda200f5348cf4ff2916c89fcf Mon Sep 17 00:00:00 2001
From: Mathias Brodala <mbrodala@pagemachine.de>
Date: Sat, 17 Mar 2018 15:55:08 +0100
Subject: [PATCH] [TASK] Rename ImageManipulationWizard to
 ImageManipulationController

Change-Id: Ibb5038049780edcf70aae442b9f9933feeed5589
Resolves: #84409
Releases: master
Reviewed-on: https://review.typo3.org/56316
Tested-by: TYPO3com <no-reply@typo3.com>
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>
---
 .../Wizard/ImageManipulationController.php}   |  8 ++---
 .../Configuration/Backend/AjaxRoutes.php      |  2 +-
 .../backend/Migrations/Code/ClassAliasMap.php |  1 +
 .../Migrations/Code/LegacyClassesForIde.php   | 12 +++++++
 ...ecordListRenamedToRecordListController.rst |  4 +--
 ...rdRenamedToImageManipulationController.rst | 35 +++++++++++++++++++
 ...etionRenamedToCodeCompletionController.rst |  4 +--
 .../ExtensionScanner/Php/ClassNameMatcher.php |  5 +++
 8 files changed, 62 insertions(+), 9 deletions(-)
 rename typo3/sysext/backend/Classes/{Form/Wizard/ImageManipulationWizard.php => Controller/Wizard/ImageManipulationController.php} (94%)
 create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-84409-ImageManipulationWizardRenamedToImageManipulationController.rst

diff --git a/typo3/sysext/backend/Classes/Form/Wizard/ImageManipulationWizard.php b/typo3/sysext/backend/Classes/Controller/Wizard/ImageManipulationController.php
similarity index 94%
rename from typo3/sysext/backend/Classes/Form/Wizard/ImageManipulationWizard.php
rename to typo3/sysext/backend/Classes/Controller/Wizard/ImageManipulationController.php
index 69ce4d190b80..6728719dfc56 100644
--- a/typo3/sysext/backend/Classes/Form/Wizard/ImageManipulationWizard.php
+++ b/typo3/sysext/backend/Classes/Controller/Wizard/ImageManipulationController.php
@@ -1,6 +1,6 @@
 <?php
 declare(strict_types = 1);
-namespace TYPO3\CMS\Backend\Form\Wizard;
+namespace TYPO3\CMS\Backend\Controller\Wizard;
 
 /*
  * This file is part of the TYPO3 CMS project.
@@ -27,7 +27,7 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
 /**
  * Wizard for rendering image manipulation view
  */
-class ImageManipulationWizard
+class ImageManipulationController
 {
     /**
      * @var StandaloneView
@@ -54,7 +54,7 @@ class ImageManipulationWizard
      * @param ServerRequestInterface $request
      * @return ResponseInterface $response
      */
-    public function getWizardAction(ServerRequestInterface $request): ResponseInterface
+    public function getWizardContent(ServerRequestInterface $request): ResponseInterface
     {
         if ($this->isSignatureValid($request)) {
             $queryParams = json_decode($request->getQueryParams()['arguments'], true);
@@ -82,7 +82,7 @@ class ImageManipulationWizard
      * @param ServerRequestInterface $request the request with the GET parameters
      * @return bool
      */
-    protected function isSignatureValid(ServerRequestInterface $request)
+    protected function isSignatureValid(ServerRequestInterface $request): bool
     {
         $token = GeneralUtility::hmac($request->getQueryParams()['arguments'], 'ajax_wizard_image_manipulation');
         return hash_equals($token, $request->getQueryParams()['signature']);
diff --git a/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php b/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php
index cca564615ac9..b9ac917951f8 100644
--- a/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php
+++ b/typo3/sysext/backend/Configuration/Backend/AjaxRoutes.php
@@ -201,7 +201,7 @@ return [
     // Open the image manipulation wizard
     'wizard_image_manipulation' => [
         'path' => '/wizard/image-manipulation',
-        'target' => \TYPO3\CMS\Backend\Form\Wizard\ImageManipulationWizard::class . '::getWizardAction'
+        'target' => \TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController::class . '::getWizardContent'
     ],
 
     // Save a newly added online media
diff --git a/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php b/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php
index f759d9c739b0..81b11a587059 100644
--- a/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php
+++ b/typo3/sysext/backend/Migrations/Code/ClassAliasMap.php
@@ -1,4 +1,5 @@
 <?php
 return [
     'TYPO3\\CMS\\Backend\\AjaxLoginHandler' => \TYPO3\CMS\Backend\Controller\AjaxLoginController::class,
+    'TYPO3\\CMS\\Backend\\Form\\Wizard\\ImageManipulationWizard' => \TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController::class,
 ];
diff --git a/typo3/sysext/backend/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/backend/Migrations/Code/LegacyClassesForIde.php
index 72f2dfeccd51..d19be3d7a8cf 100644
--- a/typo3/sysext/backend/Migrations/Code/LegacyClassesForIde.php
+++ b/typo3/sysext/backend/Migrations/Code/LegacyClassesForIde.php
@@ -4,7 +4,19 @@ namespace {
 }
 
 namespace TYPO3\CMS\Backend {
+    /**
+     * @deprecated since v9, will be removed in v10
+     */
     class AjaxLoginHandler extends \TYPO3\CMS\Backend\Controller\AjaxLoginController
     {
     }
 }
+
+namespace TYPO3\CMS\Backend\Form\Wizard {
+    /**
+     * @deprecated since v9, will be removed in v10
+     */
+    class ImageManipulationWizard extends \TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController
+    {
+    }
+}
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst
index cf965eb94774..1b6450a6e23d 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84399-ClassRecordListRenamedToRecordListController.rst
@@ -17,7 +17,7 @@ Impact
 ======
 
 The old class name has been registered as class alias and will still work.
-Old class name usage however is discouraged and should be avoided since, the
+Old class name usage however is discouraged and should be avoided, the
 alias will vanish with core version 10.
 
 
@@ -35,4 +35,4 @@ Migration
 
 Use new class name instead.
 
-.. index:: Backend, PHP-API, FullyScanned, ext:recordlist
\ No newline at end of file
+.. index:: Backend, PHP-API, FullyScanned, ext:recordlist
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84409-ImageManipulationWizardRenamedToImageManipulationController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84409-ImageManipulationWizardRenamedToImageManipulationController.rst
new file mode 100644
index 000000000000..d3ce1481335b
--- /dev/null
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84409-ImageManipulationWizardRenamedToImageManipulationController.rst
@@ -0,0 +1,35 @@
+.. include:: ../../Includes.txt
+
+====================================================================================
+Deprecation: #84409 - ImageManipulationWizard renamed to ImageManipulationController
+====================================================================================
+
+See :issue:`84409`
+
+Description
+===========
+
+The PHP class :php:`TYPO3\CMS\Backend\Form\Wizard\ImageManipulationWizard` has been renamed to
+:php:`TYPO3\CMS\Backend\Controller\Wizard\ImageManipulationController`.
+
+
+Impact
+======
+
+The old class name has been registered as class alias and will still work.
+Old class name usage however is discouraged and should be avoided, the
+alias will vanish with core version 10.
+
+
+Affected Installations
+======================
+
+Extensions which use the old class name are affected. The extension scanner will find affected extensions using the old class name.
+
+
+Migration
+=========
+
+Use new class name instead.
+
+.. index:: Backend, PHP-API, FullyScanned
diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst
index 2644cd040b78..af5fb62135cd 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst
@@ -17,7 +17,7 @@ Impact
 ======
 
 The old class name has been registered as class alias and will still work.
-Old class name usage however is discouraged and should be avoided since, the
+Old class name usage however is discouraged and should be avoided, the
 alias will vanish with core version 10.
 
 
@@ -32,4 +32,4 @@ Migration
 
 Use new class name instead.
 
-.. index:: Backend, PHP-API, FullyScanned, ext:t3editor
\ No newline at end of file
+.. index:: Backend, PHP-API, FullyScanned, ext:t3editor
diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
index a2f024d42433..61dfed7b006f 100644
--- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
+++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php
@@ -664,4 +664,9 @@ return [
             'Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst',
         ],
     ],
+    'TYPO3\CMS\Backend\Form\Wizard\ImageManipulationWizard' => [
+        'restFiles' => [
+            'Deprecation-84409-ImageManipulationWizardRenamedToImageManipulationController.rst',
+        ],
+    ],
 ];
-- 
GitLab