WordPress\AiClient\Providers\Http\DTO

RequestOptions::toArraypublicWP 0.2.0

{@inheritDoc}

Method of the class: RequestOptions{}

No Hooks.

Returns

RequestOptionsArrayShape.

Usage

$RequestOptions = new RequestOptions();
$RequestOptions->toArray(): array;

Changelog

Since 0.2.0 Introduced.

RequestOptions::toArray() code WP 7.0

public function toArray(): array
{
    $data = [];
    if ($this->timeout !== null) {
        $data[self::KEY_TIMEOUT] = $this->timeout;
    }
    if ($this->connectTimeout !== null) {
        $data[self::KEY_CONNECT_TIMEOUT] = $this->connectTimeout;
    }
    if ($this->maxRedirects !== null) {
        $data[self::KEY_MAX_REDIRECTS] = $this->maxRedirects;
    }
    return $data;
}