diff --git a/composer.json b/composer.json index a0c100488233a5d3a5a2bffa5fe2be7aee28321d..bb55b82024ef6deec18e06cfd9aaa3da8c11106f 100644 --- a/composer.json +++ b/composer.json @@ -89,6 +89,7 @@ "typo3/sysext/recordlist/Migrations/Code/ClassAliasMap.php", "typo3/sysext/reports/Migrations/Code/ClassAliasMap.php", "typo3/sysext/saltedpasswords/Migrations/Code/ClassAliasMap.php", + "typo3/sysext/t3editor/Migrations/Code/ClassAliasMap.php", "typo3/sysext/workspaces/Migrations/Code/ClassAliasMap.php" ] }, diff --git a/composer.lock b/composer.lock index 898274f867e4f2a0aa2500fd2b23cc050cfd1c56..bced5a14decf6ca805f84657f1e9bc502a606cfd 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "33161a8bc06421b8de725e3dfb422fae", + "content-hash": "9e7e4b2f0374c71e482a335873a428aa", "packages": [ { "name": "cogpowered/finediff", diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst new file mode 100644 index 0000000000000000000000000000000000000000..2644cd040b789859cc8b6553724ebd46b03d4d64 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst @@ -0,0 +1,35 @@ +.. include:: ../../Includes.txt + +======================================================================== +Deprecation: #84410 - CodeCompletion renamed to CodeCompletionController +======================================================================== + +See :issue:`84410` + +Description +=========== + +The PHP class :php:`TYPO3\CMS\T3editor\CodeCompletion` has been renamed to +:php:`TYPO3\CMS\T3editor\Controller\CodeCompletionController`. + + +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 +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, ext:t3editor \ No newline at end of file diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php index 5ac17f7bfcd25d651429351f1bfe0cfab02186e2..a2f024d42433e8622fa559c52aa918ef1d6938b1 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/ClassNameMatcher.php @@ -659,4 +659,9 @@ return [ 'Deprecation-84399-ClassRecordListRenamedToRecordListController.rst', ], ], + 'TYPO3\CMS\T3editor\CodeCompletion' => [ + 'restFiles' => [ + 'Deprecation-84410-CodeCompletionRenamedToCodeCompletionController.rst', + ], + ], ]; diff --git a/typo3/sysext/t3editor/Classes/CodeCompletion.php b/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php similarity index 96% rename from typo3/sysext/t3editor/Classes/CodeCompletion.php rename to typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php index 5770cb21df2467d0ed03d2fb79300c1a636118c7..a9e9980d8af151969dc188ca93838fcbedb3abba 100644 --- a/typo3/sysext/t3editor/Classes/CodeCompletion.php +++ b/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php @@ -1,5 +1,5 @@ <?php -namespace TYPO3\CMS\T3editor; +namespace TYPO3\CMS\T3editor\Controller; /* * This file is part of the TYPO3 CMS project. @@ -21,7 +21,7 @@ use TYPO3\CMS\Core\Http\JsonResponse; /** * Code completion for t3editor */ -class CodeCompletion +class CodeCompletionController { /** * @var \TYPO3\CMS\Core\Http\AjaxRequestHandler @@ -43,7 +43,7 @@ class CodeCompletion * @param ServerRequestInterface $request * @return ResponseInterface */ - public function processAjaxRequest(ServerRequestInterface $request): ResponseInterface + public function loadCompletions(ServerRequestInterface $request): ResponseInterface { $pageId = (int)($request->getParsedBody()['pageId'] ?? $request->getQueryParams()['pageId']); return $this->loadTemplates($pageId); diff --git a/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php b/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php index 8af7cb2ee9167ee7b11a49579ee11f257193b938..7a0f00cbd67d3eb97409059068898f12da7dc99e 100644 --- a/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php +++ b/typo3/sysext/t3editor/Configuration/Backend/AjaxRoutes.php @@ -13,6 +13,6 @@ return [ // Load code completion templates 't3editor_codecompletion_loadtemplates' => [ 'path' => '/t3editor/codecompletion/load-templates', - 'target' => \TYPO3\CMS\T3editor\CodeCompletion::class . '::processAjaxRequest' + 'target' => \TYPO3\CMS\T3editor\Controller\CodeCompletionController::class . '::loadCompletions' ] ]; diff --git a/typo3/sysext/t3editor/Migrations/Code/ClassAliasMap.php b/typo3/sysext/t3editor/Migrations/Code/ClassAliasMap.php new file mode 100644 index 0000000000000000000000000000000000000000..d8e5c23a48d7db5aa06d13a5bbfa39f936c14de5 --- /dev/null +++ b/typo3/sysext/t3editor/Migrations/Code/ClassAliasMap.php @@ -0,0 +1,4 @@ +<?php +return [ + 'TYPO3\\CMS\\T3editor\\CodeCompletion' => \TYPO3\CMS\T3editor\Controller\CodeCompletionController::class, +]; diff --git a/typo3/sysext/t3editor/Migrations/Code/LegacyClassesForIde.php b/typo3/sysext/t3editor/Migrations/Code/LegacyClassesForIde.php new file mode 100644 index 0000000000000000000000000000000000000000..44cfd020bcfb9b58423bb2a78fa42a83c2970882 --- /dev/null +++ b/typo3/sysext/t3editor/Migrations/Code/LegacyClassesForIde.php @@ -0,0 +1,13 @@ +<?php +namespace { + die('Access denied'); +} + +namespace TYPO3\CMS\T3editor { + /** + * @deprecated since v9, will be removed in v10 + */ + class CodeCompletion extends \TYPO3\CMS\T3editor\Controller\CodeCompletionController + { + } +} diff --git a/typo3/sysext/t3editor/composer.json b/typo3/sysext/t3editor/composer.json index 7f2a88ba5efb8a3a30240900876e1622433b603d..6610a3ed73f2824eff452abcd35510099df17f2f 100644 --- a/typo3/sysext/t3editor/composer.json +++ b/typo3/sysext/t3editor/composer.json @@ -28,6 +28,11 @@ "partOfFactoryDefault": true }, "extension-key": "t3editor" + }, + "typo3/class-alias-loader": { + "class-alias-maps": [ + "Migrations/Code/ClassAliasMap.php" + ] } }, "autoload": {