Automattic\WooCommerce\Vendor\GraphQL\Utils

MixedStore::offsetExistspublicWC 1.0ReturnTypeWillChange

Method of the class: MixedStore{}

No Hooks.

Returns

null. Nothing (null).

Usage

$MixedStore = new MixedStore();
$MixedStore->offsetExists( $offset ): bool;
$offset(mixed) (required)
.

MixedStore::offsetExists() code WC 10.9.1

public function offsetExists($offset): bool
{
    if ($offset === false) {
        return $this->falseValueIsSet;
    }

    if ($offset === true) {
        return $this->trueValueIsSet;
    }

    if (is_int($offset) || is_string($offset)) {
        return array_key_exists($offset, $this->standardStore);
    }

    if (is_float($offset)) {
        return array_key_exists((string) $offset, $this->floatStore);
    }

    if (is_object($offset)) {
        return $this->objectStore->offsetExists($offset);
    }

    if (is_array($offset)) {
        foreach ($this->arrayKeys as $index => $entry) {
            if ($entry === $offset) {
                $this->lastArrayKey = $offset;
                $this->lastArrayValue = $this->arrayValues[$index];

                return true;
            }
        }
    }

    if ($offset === null) {
        return $this->nullValueIsSet;
    }

    return false;
}