original_string: protected function _shutdown()
      {
          $this->controller->dispatchEvent('Controller.shutdown');
          $dispatcher = DispatcherFactory::create();
          $eventManager = $dispatcher->getEventManager();
          foreach ($dispatcher->filters() as $filter) {
              $eventManager->on($filter);
          }
          $args = [
              'request' => $this->controller->request,
              'response' => $this->controller->response
          ];
          $result = $dispatcher->dispatchEvent('Dispatcher.afterDispatch', $args);
  
          return $result->getData('response');
      }
code: protected function _shutdown()
      {
          $this->controller->dispatchEvent('Controller.shutdown');
          $dispatcher = DispatcherFactory::create();
          $eventManager = $dispatcher->getEventManager();
          foreach ($dispatcher->filters() as $filter) {
              $eventManager->on($filter);
          }
          $args = [
              'request' => $this->controller->request,
              'response' => $this->controller->response
          ];
          $result = $dispatcher->dispatchEvent('Dispatcher.afterDispatch', $args);
  
          return $result->getData('response');
      }
code_tokens: protected function _shutdown ( ) { $ this -> controller -> dispatchEvent ( 'Controller.shutdown' ) ; $ dispatcher = DispatcherFactory :: create ( ) ; $ eventManager = $ dispatcher -> getEventManager ( ) ; foreach ( $ dispatcher -> filters ( ) as $ filter ) { $ eventManager -> on ( $ filter ) ; } $ args = [ 'request' => $ this -> controller -> request , 'response' => $ this -> controller -> response ] ; $ result = $ dispatcher -> dispatchEvent ( 'Dispatcher.afterDispatch' , $ args ) ; return $ result -> getData ( 'response' ) ; }
docstring: Run the shutdown events.
  
  Triggers the afterFilter and afterDispatch events.
  
  @return \Cake\Http\Response The response to serve.
docstring_tokens: Run the shutdown events .