WordPress\AiClient\Providers\Http\DTO
RequestOptions::fromArray
{@inheritDoc}
Method of the class: RequestOptions{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = RequestOptions::fromArray( $array ): self;
- $array(array) (required)
- .
Changelog
| Since 0.2.0 | Introduced. |
RequestOptions::fromArray() RequestOptions::fromArray code WP 7.0
public static function fromArray(array $array): self
{
$instance = new self();
if (isset($array[self::KEY_TIMEOUT])) {
$instance->setTimeout((float) $array[self::KEY_TIMEOUT]);
}
if (isset($array[self::KEY_CONNECT_TIMEOUT])) {
$instance->setConnectTimeout((float) $array[self::KEY_CONNECT_TIMEOUT]);
}
if (isset($array[self::KEY_MAX_REDIRECTS])) {
$instance->setMaxRedirects((int) $array[self::KEY_MAX_REDIRECTS]);
}
return $instance;
}