private function beforeAfterController(string $when): void
    {
        if (\method_exists($this->controller, $when)) {
            \call_user_func([$this->controller, $when]);
        }
    }
private function beforeAfterController(string $when): void
    {
        if (\method_exists($this->controller, $when)) {
            \call_user_func([$this->controller, $when]);
        }
    }
private function beforeAfterController ( string $ when ) : void { if ( \ method_exists ( $ this -> controller , $ when ) ) { \ call_user_func ( [ $ this -> controller , $ when ] ) ; } }
Run action before or after controller execution.

@param string $when

@return void
Run action before or after controller execution .