public static function getRequest($current = false)
    {
        if ($current) {
            $request = end(static::$_requests);

            return $request ?: null;
        }

        return isset(static::$_requests[0]) ? static::$_requests[0] : null;
    }
public static function getRequest($current = false)
    {
        if ($current) {
            $request = end(static::$_requests);

            return $request ?: null;
        }

        return isset(static::$_requests[0]) ? static::$_requests[0] : null;
    }
public static function getRequest ( $ current = false ) { if ( $ current ) { $ request = end ( static :: $ _requests ) ; return $ request ? : null ; } return isset ( static :: $ _requests [ 0 ] ) ? static :: $ _requests [ 0 ] : null ; }
Get the current request object, or the first one.

@param bool $current True to get the current request, or false to get the first one.
@return \Cake\Http\ServerRequest|null
Get the current request object or the first one .