private static function getAttribute(ServerRequestInterface $request, $name, $default = null)
    {
        $attributes = $request->getAttribute(Middleware::KEY, []);

        if (isset($attributes[$name])) {
            return $attributes[$name];
        }

        return $default;
    }
private static function getAttribute(ServerRequestInterface $request, $name, $default = null)
    {
        $attributes = $request->getAttribute(Middleware::KEY, []);

        if (isset($attributes[$name])) {
            return $attributes[$name];
        }

        return $default;
    }
private static function getAttribute ( ServerRequestInterface $ request , $ name , $ default = null ) { $ attributes = $ request -> getAttribute ( Middleware :: KEY , [ ] ) ; if ( isset ( $ attributes [ $ name ] ) ) { return $ attributes [ $ name ] ; } return $ default ; }
Retrieves an attribute from the request.

@param ServerRequestInterface $request
@param string                 $name
@param mixed|null             $default

@return mixed|null
Retrieves an attribute from the request .