WordPress\AiClientDependencies\Nyholm\Psr7
ServerRequest::withAttribute
Method of the class: ServerRequest{}
No Hooks.
Returns
static.
Usage
$ServerRequest = new ServerRequest(); $ServerRequest->withAttribute( $attribute, $value ): ServerRequestInterface;
- $attribute(required)
- .
- $value(required)
- .
ServerRequest::withAttribute() ServerRequest::withAttribute code WP 7.0
public function withAttribute($attribute, $value): ServerRequestInterface
{
if (!\is_string($attribute)) {
throw new \InvalidArgumentException('Attribute name must be a string');
}
$new = clone $this;
$new->attributes[$attribute] = $value;
return $new;
}