Automattic\WooCommerce\Vendor\GraphQL\Utils

MixedStore::offsetSetpublicWC 1.0ReturnTypeWillChange

Method of the class: MixedStore{}

No Hooks.

Returns

null. Nothing (null).

Usage

$MixedStore = new MixedStore();
$MixedStore->offsetSet( $offset, $value ): void;
$offset(mixed) (required)
.
$value(TValue) (required)
.

MixedStore::offsetSet() code WC 10.9.1

public function offsetSet($offset, $value): void
{
    if ($offset === false) {
        $this->falseValue = $value;
        $this->falseValueIsSet = true;
    } elseif ($offset === true) {
        $this->trueValue = $value;
        $this->trueValueIsSet = true;
    } elseif (is_int($offset) || is_string($offset)) {
        $this->standardStore[$offset] = $value;
    } elseif (is_float($offset)) {
        $this->floatStore[(string) $offset] = $value;
    } elseif (is_object($offset)) {
        $this->objectStore[$offset] = $value;
    } elseif (is_array($offset)) {
        $this->arrayKeys[] = $offset;
        $this->arrayValues[] = $value;
    } elseif ($offset === null) {
        $this->nullValue = $value;
        $this->nullValueIsSet = true;
    } else {
        $unexpectedOffset = Utils::printSafe($offset);
        throw new \InvalidArgumentException("Unexpected offset type: {$unexpectedOffset}");
    }
}