src/Weew/HttpBlueprint/ResponseBuilder.php
public function buildResponseForRoute(IRoute $route) {
        $abstract = $route->getAction();

        if ($abstract instanceof IHttpResponse) {
            return $abstract;
        } else {
            $response = $abstract;

            if ($abstract instanceof Closure) {
                $response = $abstract(new CurrentRequest(), $route->getParameters());
            }

            if ( ! $response instanceof IHttpResponse) {
                $response = $this->createResponse(HttpStatusCode::OK, $response);
            }

            return $response;
        }
    }
public function buildResponseForRoute(IRoute $route) {
        $abstract = $route->getAction();

        if ($abstract instanceof IHttpResponse) {
            return $abstract;
        } else {
            $response = $abstract;

            if ($abstract instanceof Closure) {
                $response = $abstract(new CurrentRequest(), $route->getParameters());
            }

            if ( ! $response instanceof IHttpResponse) {
                $response = $this->createResponse(HttpStatusCode::OK, $response);
            }

            return $response;
        }
    }
public function buildResponseForRoute ( IRoute $ route ) { $ abstract = $ route -> getAction ( ) ; if ( $ abstract instanceof IHttpResponse ) { return $ abstract ; } else { $ response = $ abstract ; if ( $ abstract instanceof Closure ) { $ response = $ abstract ( new CurrentRequest ( ) , $ route -> getParameters ( ) ) ; } if ( ! $ response instanceof IHttpResponse ) { $ response = $ this -> createResponse ( HttpStatusCode :: OK , $ response ) ; } return $ response ; } }
@param IRoute $route

@return null|HttpResponse
@param IRoute $route