src/Control/Director.php
protected static function currentRequest(HTTPRequest $request = null)
    {
        // Ensure we only use a registered HTTPRequest and don't
        // incidentally construct a singleton
        if (!$request && Injector::inst()->has(HTTPRequest::class)) {
            $request = Injector::inst()->get(HTTPRequest::class);
        }
        return $request;
    }
protected static function currentRequest(HTTPRequest $request = null)
    {
        // Ensure we only use a registered HTTPRequest and don't
        // incidentally construct a singleton
        if (!$request && Injector::inst()->has(HTTPRequest::class)) {
            $request = Injector::inst()->get(HTTPRequest::class);
        }
        return $request;
    }
protected static function currentRequest ( HTTPRequest $ request = null ) { // Ensure we only use a registered HTTPRequest and don't // incidentally construct a singleton if ( ! $ request && Injector :: inst ( ) -> has ( HTTPRequest :: class ) ) { $ request = Injector :: inst ( ) -> get ( HTTPRequest :: class ) ; } return $ request ; }
Helper to validate or check the current request object

@param HTTPRequest $request
@return HTTPRequest Request object if one is both current and valid
Helper to validate or check the current request object