RequestOptions::fromArray( $array )

In this article

{@inheritDoc}

Source

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;
}

Changelog

VersionDescription
0.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.