WordPress\AiClient\Providers\Http\DTO

Response::fromArraypublic staticWP 0.1.0

{@inheritDoc}

Method of the class: Response{}

No Hooks.

Returns

null. Nothing (null).

Usage

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

Changelog

Since 0.1.0 Introduced.

Response::fromArray() code WP 7.1

public static function fromArray(array $array): self
{
    static::validateFromArrayData($array, [self::KEY_STATUS_CODE, self::KEY_HEADERS]);
    return new self($array[self::KEY_STATUS_CODE], $array[self::KEY_HEADERS], $array[self::KEY_BODY] ?? null);
}