Skip to content

Commit

Permalink
[!!!][TASK] Remove Application->run callback
Browse files Browse the repository at this point in the history
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 <typo3@b13.com>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
o-ba authored and lolli42 committed Dec 2, 2021
1 parent 3c2b8fa commit 5af323c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
9 changes: 1 addition & 8 deletions typo3/sysext/core/Classes/Console/CommandApplication.php
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 1 addition & 3 deletions typo3/sysext/core/Classes/Core/ApplicationInterface.php
Expand Up @@ -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();
}
8 changes: 1 addition & 7 deletions typo3/sysext/core/Classes/Http/AbstractApplication.php
Expand Up @@ -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);
}
}
Expand Up @@ -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:
Expand Down
Expand Up @@ -301,6 +301,7 @@
'maximumNumberOfArguments' => 0,
'restFiles' => [
'Deprecation-94272-DeprecatedApplication-runCallback.rst',
'Breaking-96107-DeprecatedFunctionalityRemoved.rst',
],
],
'TYPO3\CMS\Core\Database\RelationHandler->writeForeignField' => [
Expand Down

0 comments on commit 5af323c

Please sign in to comment.