public function isCallableOrException()
    {
        $validController = $this->isValidController();

        $isMethod   = null;
        $isCallable = null;

        if ($validController) {
            $isMethod   = method_exists($this->controller, $this->action);
            $isCallable = $this->isCallable();
        }

        if (!($isMethod && $isCallable)) {
            $msg =
                "Trying to dispatch/forward to a non callable item. Controllername = '"
                . $this->controllerName
                . "', Action = '"
                . $this->action
                . "'."
            ;

            $not = $validController ? "" : "NOT";
            $msg .=
                " The controller named '$this->controllerName' does $not exist as part of of the
                service-container \$di.
                ";

            $services = $this->di->getServices();
            natcasesort($services);
            $services = implode("\n", $services);
            $msg .= " Loaded services are: <pre>$services</pre>\n";

            if ($validController) {
                $not = $isMethod ? "" : "NOT";
                $msg .= " The method '$this->action' does $not exist in the class '$this->controllerName'.";

                $not = $isCallable ? "" : "NOT";
                $msg .=
                    " The method '$this->action' is $not callable in the class '$this->controllerName'
                    (taking magic methods into consideration).";
            }

            throw new \Exception($msg);
        }
    }
public function isCallableOrException()
    {
        $validController = $this->isValidController();

        $isMethod   = null;
        $isCallable = null;

        if ($validController) {
            $isMethod   = method_exists($this->controller, $this->action);
            $isCallable = $this->isCallable();
        }

        if (!($isMethod && $isCallable)) {
            $msg =
                "Trying to dispatch/forward to a non callable item. Controllername = '"
                . $this->controllerName
                . "', Action = '"
                . $this->action
                . "'."
            ;

            $not = $validController ? "" : "NOT";
            $msg .=
                " The controller named '$this->controllerName' does $not exist as part of of the
                service-container \$di.
                ";

            $services = $this->di->getServices();
            natcasesort($services);
            $services = implode("\n", $services);
            $msg .= " Loaded services are: <pre>$services</pre>\n";

            if ($validController) {
                $not = $isMethod ? "" : "NOT";
                $msg .= " The method '$this->action' does $not exist in the class '$this->controllerName'.";

                $not = $isCallable ? "" : "NOT";
                $msg .=
                    " The method '$this->action' is $not callable in the class '$this->controllerName'
                    (taking magic methods into consideration).";
            }

            throw new \Exception($msg);
        }
    }
public function isCallableOrException ( ) { $ validController = $ this -> isValidController ( ) ; $ isMethod = null ; $ isCallable = null ; if ( $ validController ) { $ isMethod = method_exists ( $ this -> controller , $ this -> action ) ; $ isCallable = $ this -> isCallable ( ) ; } if ( ! ( $ isMethod && $ isCallable ) ) { $ msg = "Trying to dispatch/forward to a non callable item. Controllername = '" . $ this -> controllerName . "', Action = '" . $ this -> action . "'." ; $ not = $ validController ? "" : "NOT" ; $ msg .= " The controller named '$this->controllerName' does $not exist as part of of the
                service-container \$di.
                " ; $ services = $ this -> di -> getServices ( ) ; natcasesort ( $ services ) ; $ services = implode ( "\n" , $ services ) ; $ msg .= " Loaded services are: <pre>$services</pre>\n" ; if ( $ validController ) { $ not = $ isMethod ? "" : "NOT" ; $ msg .= " The method '$this->action' does $not exist in the class '$this->controllerName'." ; $ not = $ isCallable ? "" : "NOT" ; $ msg .= " The method '$this->action' is $not callable in the class '$this->controllerName'
                    (taking magic methods into consideration)." ; } throw new \ Exception ( $ msg ) ; } }
Inspect if callable and throw exception if parts is not callable.

@return void
@throws \Exception
Inspect if callable and throw exception if parts is not callable .