WordPress\AiClientDependencies\Nyholm\Psr7

ServerRequest::getAttributepublicWP 1.0

Method of the class: ServerRequest{}

No Hooks.

Returns

Mixed.

Usage

$ServerRequest = new ServerRequest();
$ServerRequest->getAttribute( $attribute, $default );
$attribute(required)
.
$default
.
Default: null

ServerRequest::getAttribute() code WP 7.0

public function getAttribute($attribute, $default = null)
{
    if (!\is_string($attribute)) {
        throw new \InvalidArgumentException('Attribute name must be a string');
    }
    if (\false === \array_key_exists($attribute, $this->attributes)) {
        return $default;
    }
    return $this->attributes[$attribute];
}