WordPress\AiClient\Providers\Http\DTO

Request::fromArray │ public static │ WP 0.1.0

{@inheritDoc}

Method of the class: Request{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = Request::fromArray( $array ): self;
$array(array) (required)
.

Changelog

Since 0.1.0 Introduced.

Request::fromArray() code WP 7.1.4

public static function fromArray(array $array): self
{
    static::validateFromArrayData($array, [self::KEY_METHOD, self::KEY_URI, self::KEY_HEADERS]);
    return new self(HttpMethodEnum::from($array[self::KEY_METHOD]), $array[self::KEY_URI], $array[self::KEY_HEADERS] ?? [], $array[self::KEY_BODY] ?? null, isset($array[self::KEY_OPTIONS]) ? \WordPress\AiClient\Providers\Http\DTO\RequestOptions::fromArray($array[self::KEY_OPTIONS]) : null);
}