Skip to content

Commit 967aa6d

Browse files
committed
Restore Profiler for postdispatch, remove @TODO and change @deprecated message
1 parent 472e808 commit 967aa6d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/internal/Magento/Framework/App/Action/Action.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
* It contains standard action behavior (event dispatching, flag checks)
2424
* Action classes that do not extend from this class will lose this behavior and might not function correctly
2525
*
26-
* @TODO: Remove this class. Allow implementation of Action Controllers by just implementing Action Interface.
27-
* @deprecated Use \Magento\Framework\App\ActionInterface instead
26+
* @deprecated 2.4.0, use \Magento\Framework\App\ActionInterface
2827
*
2928
* phpcs:disable Magento2.Classes.AbstractApi
3029
* @api

lib/internal/Magento/Framework/App/Action/Plugin/EventDispatchPlugin.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\Controller\ResultInterface;
1717
use Magento\Framework\Event\ManagerInterface;
1818
use Magento\Framework\HTTP\PhpEnvironment\Response;
19+
use Magento\Framework\Profiler;
1920

2021
/**
2122
* Dispatch the controller_action_predispatch and controller_action_post_dispatch events.
@@ -63,7 +64,7 @@ public function beforeExecute(ActionInterface $subject)
6364
* Build the event parameter array
6465
*
6566
* @param ActionInterface $subject
66-
* @return mixed[]
67+
* @return array
6768
*/
6869
private function getEventParameters(ActionInterface $subject): array
6970
{
@@ -89,7 +90,6 @@ public function afterExecute(ActionInterface $subject, $result)
8990
/**
9091
* Check if action flags are set that would suppress the post dispatch events.
9192
*
92-
* @param ActionInterface $subject
9393
* @return bool
9494
*/
9595
private function isSetActionNoPostDispatchFlag(): bool
@@ -123,6 +123,7 @@ private function dispatchPreDispatchEvents(ActionInterface $action)
123123
*/
124124
private function dispatchPostDispatchEvents(ActionInterface $action)
125125
{
126+
Profiler::start('postdispatch');
126127
$this->eventManager->dispatch(
127128
'controller_action_postdispatch_' . $this->request->getFullActionName(),
128129
$this->getEventParameters($action)
@@ -132,5 +133,6 @@ private function dispatchPostDispatchEvents(ActionInterface $action)
132133
$this->getEventParameters($action)
133134
);
134135
$this->eventManager->dispatch('controller_action_postdispatch', $this->getEventParameters($action));
136+
Profiler::stop('postdispatch');
135137
}
136138
}

0 commit comments

Comments
 (0)