src/Control/Middleware/CanonicalURLMiddleware.php
protected function getOrValidateRequest(HTTPRequest $request = null)
    {
        if ($request instanceof HTTPRequest) {
            return $request;
        }
        if (Injector::inst()->has(HTTPRequest::class)) {
            return Injector::inst()->get(HTTPRequest::class);
        }
        return null;
    }
protected function getOrValidateRequest(HTTPRequest $request = null)
    {
        if ($request instanceof HTTPRequest) {
            return $request;
        }
        if (Injector::inst()->has(HTTPRequest::class)) {
            return Injector::inst()->get(HTTPRequest::class);
        }
        return null;
    }
protected function getOrValidateRequest ( HTTPRequest $ request = null ) { if ( $ request instanceof HTTPRequest ) { return $ request ; } if ( Injector :: inst ( ) -> has ( HTTPRequest :: class ) ) { return Injector :: inst ( ) -> get ( HTTPRequest :: class ) ; } return null ; }
Return a valid request, if one is available, or null if none is available

@param HTTPRequest $request
@return HTTPRequest|null
Return a valid request if one is available or null if none is available