src/Controller/Controller.php
public function dispatch($action, ServerRequestInterface $request) : ResponseInterface
    {
        $this->getLogger()->debug('dispatching to action: '.$action);
        if (!method_exists($this, $action) && !method_exists($this, '__call')) {
            throw new ActionDoesNotExistException();
        }

        $response = $this->$action($request);
        return $response;
    }
public function dispatch($action, ServerRequestInterface $request) : ResponseInterface
    {
        $this->getLogger()->debug('dispatching to action: '.$action);
        if (!method_exists($this, $action) && !method_exists($this, '__call')) {
            throw new ActionDoesNotExistException();
        }

        $response = $this->$action($request);
        return $response;
    }
public function dispatch ( $ action , ServerRequestInterface $ request ) : ResponseInterface { $ this -> getLogger ( ) -> debug ( 'dispatching to action: ' . $ action ) ; if ( ! method_exists ( $ this , $ action ) && ! method_exists ( $ this , '__call' ) ) { throw new ActionDoesNotExistException ( ) ; } $ response = $ this -> $ action ( $ request ) ; return $ response ; }
function to dispatch requests coming through the router

@param $action
@param ServerRequestInterface $request
@return ResponseInterface
@throws ActionDoesNotExistException
function to dispatch requests coming through the router