From 5af323ca083248e8aac761b5def3d97ff9701c28 Mon Sep 17 00:00:00 2001 From: Oliver Bartsch Date: Thu, 2 Dec 2021 12:48:57 +0100 Subject: [PATCH] [!!!][TASK] Remove Application->run callback The callback arguments in Application->run() is removed in favour of PSR-15 middlewares. Resolves: #96192 Related: #94272 Releases: main Change-Id: I7db4278fde0361840bdc275736961b2c49241233 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72452 Tested-by: core-ci Tested-by: Wouter Wolters Tested-by: Christian Kuhn Reviewed-by: Wouter Wolters Reviewed-by: Christian Kuhn --- typo3/sysext/core/Classes/Console/CommandApplication.php | 9 +-------- typo3/sysext/core/Classes/Core/ApplicationInterface.php | 4 +--- typo3/sysext/core/Classes/Http/AbstractApplication.php | 8 +------- .../Breaking-96107-DeprecatedFunctionalityRemoved.rst | 1 + .../Php/MethodArgumentDroppedMatcher.php | 1 + 5 files changed, 5 insertions(+), 18 deletions(-) diff --git a/typo3/sysext/core/Classes/Console/CommandApplication.php b/typo3/sysext/core/Classes/Console/CommandApplication.php index f6d3d8133f9d..4fb7849fd90d 100644 --- a/typo3/sysext/core/Classes/Console/CommandApplication.php +++ b/typo3/sysext/core/Classes/Console/CommandApplication.php @@ -82,10 +82,8 @@ public function __construct( /** * Run the Symfony Console application in this TYPO3 application - * - * @param callable $execute Deprecated, will be removed in TYPO3 v12.0 */ - public function run(callable $execute = null) + public function run() { $input = new ArgvInput(); $output = new ConsoleOutput(); @@ -118,11 +116,6 @@ public function run(callable $execute = null) $exitCode = $this->application->run($input, $output); - if ($execute !== null) { - trigger_error('Custom execution of Application code will be removed in TYPO3 v12.0.', E_USER_DEPRECATED); - $execute(); - } - exit($exitCode); } diff --git a/typo3/sysext/core/Classes/Core/ApplicationInterface.php b/typo3/sysext/core/Classes/Core/ApplicationInterface.php index f34b05bffb9b..41a68bf385b6 100644 --- a/typo3/sysext/core/Classes/Core/ApplicationInterface.php +++ b/typo3/sysext/core/Classes/Core/ApplicationInterface.php @@ -25,8 +25,6 @@ interface ApplicationInterface { /** * Starting point - * - * @param callable $execute Deprecated, will be removed in TYPO3 v12.0 */ - public function run(callable $execute = null); + public function run(); } diff --git a/typo3/sysext/core/Classes/Http/AbstractApplication.php b/typo3/sysext/core/Classes/Http/AbstractApplication.php index e3379a284888..c72c185a2211 100644 --- a/typo3/sysext/core/Classes/Http/AbstractApplication.php +++ b/typo3/sysext/core/Classes/Http/AbstractApplication.php @@ -92,16 +92,10 @@ public function handle(ServerRequestInterface $request): ResponseInterface /** * Set up the application and shut it down afterwards - * - * @param callable $execute Deprecated, will be removed in TYPO3 v12.0 */ - final public function run(callable $execute = null) + final public function run() { $response = $this->handle(ServerRequestFactory::fromGlobals()); - if ($execute !== null) { - trigger_error('Custom execution of Application code will be removed in TYPO3 v12.0, use PSR-15 Middlewares instead.', E_USER_DEPRECATED); - $execute(); - } $this->sendResponse($response); } } diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst index 4a689f2b1d6c..8640ee18912c 100644 --- a/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Breaking-96107-DeprecatedFunctionalityRemoved.rst @@ -97,6 +97,7 @@ The following PHP static class methods that have previously been marked as depre The following methods changed signature according to previous deprecations in v11 at the end of the argument list: +- :php:`\TYPO3\CMS\Core\Core\ApplicationInterface->run` (argument 1 is removed) - :php:`\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->ATagParams` (argument 2 is removed) The following methods changed signature according to previous deprecations in v11 and are now type hinted: diff --git a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedMatcher.php b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedMatcher.php index ea257b5bc6f6..5e74e45392a5 100644 --- a/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedMatcher.php +++ b/typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodArgumentDroppedMatcher.php @@ -301,6 +301,7 @@ 'maximumNumberOfArguments' => 0, 'restFiles' => [ 'Deprecation-94272-DeprecatedApplication-runCallback.rst', + 'Breaking-96107-DeprecatedFunctionalityRemoved.rst', ], ], 'TYPO3\CMS\Core\Database\RelationHandler->writeForeignField' => [