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

        if (empty($attributes)) {
            return false;
        }

        return array_key_exists($name, $attributes);
    }
private static function hasAttribute(ServerRequestInterface $request, $name)
    {
        $attributes = $request->getAttribute(Middleware::KEY);

        if (empty($attributes)) {
            return false;
        }

        return array_key_exists($name, $attributes);
    }
private static function hasAttribute ( ServerRequestInterface $ request , $ name ) { $ attributes = $ request -> getAttribute ( Middleware :: KEY ) ; if ( empty ( $ attributes ) ) { return false ; } return array_key_exists ( $ name , $ attributes ) ; }
Check whether an attribute exists.

@param ServerRequestInterface $request
@param string                 $name

@return bool
Check whether an attribute exists .