Layton/App.php
public function start()
    {
        $routeMethodSep = '>';
        $storage = $this->routeService->getStorage();
        foreach ($storage as $match => $route) {
            if (($matched = $this->matchHttpRequest($match)) !== false) {
                if (!in_array($this->request->getMethod(), $route->methods)) {
                    throw new MethodNotAllowedException();
                }
                $this->request->withAttributes($matched);

                $middleWares = new MiddleWares($this->getMiddleWareFromRoute($route));
                $decorators = $route->decorators;

                if (\is_string($route->callback)) {
                    if (strpos($route->callback, $routeMethodSep) !== false) {
                        list($controller, $method) = explode($routeMethodSep, $route->callback);
                        return $this->connectMiddlewares($controller, $method, $middleWares, $decorators);
                    }
                }

                return $this->connectMiddlewares($route->callback, '__invoke', $middleWares, $decorators);
            }
        }

        throw new NotFoundException();
    }
public function start()
    {
        $routeMethodSep = '>';
        $storage = $this->routeService->getStorage();
        foreach ($storage as $match => $route) {
            if (($matched = $this->matchHttpRequest($match)) !== false) {
                if (!in_array($this->request->getMethod(), $route->methods)) {
                    throw new MethodNotAllowedException();
                }
                $this->request->withAttributes($matched);

                $middleWares = new MiddleWares($this->getMiddleWareFromRoute($route));
                $decorators = $route->decorators;

                if (\is_string($route->callback)) {
                    if (strpos($route->callback, $routeMethodSep) !== false) {
                        list($controller, $method) = explode($routeMethodSep, $route->callback);
                        return $this->connectMiddlewares($controller, $method, $middleWares, $decorators);
                    }
                }

                return $this->connectMiddlewares($route->callback, '__invoke', $middleWares, $decorators);
            }
        }

        throw new NotFoundException();
    }
public function start ( ) { $ routeMethodSep = '>' ; $ storage = $ this -> routeService -> getStorage ( ) ; foreach ( $ storage as $ match => $ route ) { if ( ( $ matched = $ this -> matchHttpRequest ( $ match ) ) !== false ) { if ( ! in_array ( $ this -> request -> getMethod ( ) , $ route -> methods ) ) { throw new MethodNotAllowedException ( ) ; } $ this -> request -> withAttributes ( $ matched ) ; $ middleWares = new MiddleWares ( $ this -> getMiddleWareFromRoute ( $ route ) ) ; $ decorators = $ route -> decorators ; if ( \ is_string ( $ route -> callback ) ) { if ( strpos ( $ route -> callback , $ routeMethodSep ) !== false ) { list ( $ controller , $ method ) = explode ( $ routeMethodSep , $ route -> callback ) ; return $ this -> connectMiddlewares ( $ controller , $ method , $ middleWares , $ decorators ) ; } } return $ this -> connectMiddlewares ( $ route -> callback , '__invoke' , $ middleWares , $ decorators ) ; } } throw new NotFoundException ( ) ; }
Match routers and call the callback.

@throws NotFoundException
@throws MethodNotAllowedException
Match routers and call the callback .