Validate array type

@param mixed $value

@return bool
169553
private function validateArrayType($value): bool
    {
        if (is_array($value) === false) {
            return false;
        }
        $count = 0;
        foreach ($value as $i => $item) {
            //not a array, but a hash/map
            if ($count !== $i) {
                return false;
            }
            $count++;
        }
        return true;
    }
249495
public function isValid($value)
    {
        $this->messages = [];
        $isValid = true;

        foreach ($this->collection as $validator) {
            $isValid = $validator->isValid($value) && $isValid;
            $messages = $validator->getMessages();
            $this->messages = array_merge($this->messages, $messages);
        }

        return $isValid;
    }
825724
public static function isValidIdArray($value): bool
    {
        if (false === \is_array($value) || 0 === \count($value)) {
            return false;
        }

        /** @var array $value */
        foreach ($value as $id) {
            if (false === self::isValidIdString($id)) {
                return false;
            }
        }

        return true;
    }
286939
public static function validate($value)
    {
        if (!is_array($value)) {
            return false;
        }
        if (isset($value['from']) && IdentityValidator::validate($value['from']) === false) {
            return false;
        }
        if (isset($value['to']) && IdentityValidator::validate($value['to']) === false) {
            return false;
        }
        if (!isset($value['topics']) || !is_array($value['topics'])) {
            return false;
        }
        foreach ($value['topics'] as $topic) {
            if (IdentityValidator::validate($topic) === false) {
                return false;
            }
        }
        if (!isset($value['payload'])) {
            return false;
        }
        if (HexValidator::validate($value['payload']) === false) {
            return false;
        }
        if (!isset($value['priority'])) {
            return false;
        }
        if (QuantityValidator::validate($value['priority']) === false) {
            return false;
        }
        if (!isset($value['ttl'])) {
            return false;
        }
        if (isset($value['ttl']) && QuantityValidator::validate($value['ttl']) === false) {
            return false;
        }
        return true;
    }
917290
public function containsValue($value): bool {
        TypeHelper::validateValue($value, $this);
        foreach ($this as $v) {
            if ($value == $v) {
                return true;
            }
        }

        return false;
    }
698372
public function isValueValid($value) {
		return $value instanceof DataType\BooleanType || $value instanceof DataType\NumberType || $value instanceof Type\StructuredValue || $value instanceof DataType\TextType;
	}
822230
public static function validValue($value): bool
    {
        $enumerables = self::getCache();
        $values = array_values($enumerables);

        return \in_array($value, $values, true);
    }
158181
public function isValid($value = null, array $options = []): bool
    {
        if (\count($options) > 0) {
            $this->setOptions($options);
        }
        $this->setValue(\str_replace(' ', '', (string)$value));
        $this->errors = [];

        if ($this->options['type'] == 'any') {
            $types = \array_keys($this->validationData);
        } elseif (\array_key_exists($this->options['type'], $this->validationData)) {
            $types = [$this->options['type']];
        } else {
            throw new DomainException('Unsopported credit card type: '.$this->options['type']);
        }

        $validType = $this->validateType($types);
        $validNumber = $this->validateNumber();

        return $validType && $validNumber;
    }
4754
private static function isNestedValidation(array $value)
    {
        return !(key_exists(Properties::TYPE, $value) && !is_array($value[Properties::TYPE]));
    }
676751
protected function isValid($value)
    {
        if (is_null($value)) {
            return;
        }

        if (is_array($value) || ($value instanceof \ArrayAccess) || is_object($value)) {
            foreach ($this->options['shape'] as $key => $subValidator) {
                if (is_array($value) || ($value instanceof \ArrayAccess)) {
                    if (array_key_exists($key, $value)) {
                        $subValue = $value[$key];
                    } else {
                        $subValue = null;
                    }
                } elseif (ObjectAccess::isPropertyGettable($value, $key)) {
                    $subValue = ObjectAccess::getPropertyPath($value, $key);
                } else {
                    $subValue = null;
                }

                if ($subValidator instanceof ValidatorInterface) {
                    $subResult = $subValidator->validate($subValue);
                    if ($subResult->hasErrors()) {
                        $this->result->forProperty($key)->merge($subResult);
                    }
                }
            }
        } else {
            $this->addError('Shape-value is expected to be an array or implement ArrayAccess', 1515070099);
        }
    }
763716
public static function checkValueTypes(array $types, $value)
	{
		foreach ($types as $type)
		{
			$type = strtolower($type);
			if (array_key_exists($type, self::$hints) && call_user_func(self::$hints[$type], $value)) return true;
			if (is_object($value) && @is_a($value, $type)) return true;
			if ($type === 'mixed') return true;
		}
		return false;
	}
1114225
public function isSameTypeAs($value): bool
    {
        if (!is_array($value) && !$value instanceof Traversable) {
            return false;
        }

        foreach ($value as $key => $val) {
            if (!($this->key->isSameTypeAs($key) && $this->value->isSameTypeAs($val))) {
                return false;
            }
        }

        return true;
    }
855694
public function isValid($value)
    {
        foreach ($this as $type) {
            if ($type->isValid($value)) {
                return true;
            }
        }

        return false;
    }
482889
public function validate($value)
    {
        if ($this->notBeEmpty($value)) {
            $value = json_decode($value);
            if ($value !== null) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
31510
public static function isArrayAccessible($value): bool
    {
        if (is_array($value)) {
            return true;
        }

        if (is_object($value) && ($value instanceof ArrayAccess)) {
            return true;
        }

        return false;
    }
841241
public function isValueValid($value) {
		return $value instanceof Type\PlaceType || $value instanceof Type\PostalAddressType || $value instanceof DataType\URLType;
	}
99723
protected function validateType($value)
    {
        if (!is_array($value) && (!$this->allowFalse || false !== $value)) {
            $ex = new InvalidTypeException(sprintf(
                'Invalid type for path "%s". Expected array, but got %s',
                $this->getPath(),
                gettype($value)
            ));
            if ($hint = $this->getInfo()) {
                $ex->addHint($hint);
            }
            $ex->setPath($this->getPath());

            throw $ex;
        }
    }