16
16
use Magento \Framework \Controller \ResultInterface ;
17
17
use Magento \Framework \Event \ManagerInterface ;
18
18
use Magento \Framework \HTTP \PhpEnvironment \Response ;
19
+ use Magento \Framework \Profiler ;
19
20
20
21
/**
21
22
* Dispatch the controller_action_predispatch and controller_action_post_dispatch events.
@@ -63,7 +64,7 @@ public function beforeExecute(ActionInterface $subject)
63
64
* Build the event parameter array
64
65
*
65
66
* @param ActionInterface $subject
66
- * @return mixed[]
67
+ * @return array
67
68
*/
68
69
private function getEventParameters (ActionInterface $ subject ): array
69
70
{
@@ -89,7 +90,6 @@ public function afterExecute(ActionInterface $subject, $result)
89
90
/**
90
91
* Check if action flags are set that would suppress the post dispatch events.
91
92
*
92
- * @param ActionInterface $subject
93
93
* @return bool
94
94
*/
95
95
private function isSetActionNoPostDispatchFlag (): bool
@@ -123,6 +123,7 @@ private function dispatchPreDispatchEvents(ActionInterface $action)
123
123
*/
124
124
private function dispatchPostDispatchEvents (ActionInterface $ action )
125
125
{
126
+ Profiler::start ('postdispatch ' );
126
127
$ this ->eventManager ->dispatch (
127
128
'controller_action_postdispatch_ ' . $ this ->request ->getFullActionName (),
128
129
$ this ->getEventParameters ($ action )
@@ -132,5 +133,6 @@ private function dispatchPostDispatchEvents(ActionInterface $action)
132
133
$ this ->getEventParameters ($ action )
133
134
);
134
135
$ this ->eventManager ->dispatch ('controller_action_postdispatch ' , $ this ->getEventParameters ($ action ));
136
+ Profiler::stop ('postdispatch ' );
135
137
}
136
138
}
0 commit comments