protected function validateArrayType($value, array $schema, array $types = []): ErrorResult
    {
        $result = new ErrorResult();
        if (is_array($value) === false || $this->isNumericallyIndexedArray($value) === false) {
            $result->addError($this->createError('type=array', 'type=' . gettype($value)));
            return $result;
        }

        if (isset($schema['minItems']) && count($value) < $schema['minItems']) {
            $result->addError($this->createError('minItems=' . $schema['minItems'], count($value) . ' items'));
        }

        if (isset($schema['maxItems']) && count($value) > $schema['maxItems']) {
            $result->addError($this->createError('maxItems=' . $schema['maxItems'], count($value) . ' items'));
        }

        if (isset($schema['items'])) {
            foreach ($value as $index => $itemValue) {
                $itemResult = $this->validate($itemValue, $schema['items'], $types);
                if ($itemResult->hasErrors()  === true) {
                    $result->forProperty('__index_' . $index)->merge($itemResult);
                }
            }
        }

        if (isset($schema['uniqueItems']) && $schema['uniqueItems'] === true) {
            $values = [];
            foreach ($value as $itemValue) {
                $itemHash = is_array($itemValue) ? serialize($itemValue) : $itemValue;
                if (in_array($itemHash, $values)) {
                    $result->addError($this->createError('Unique values are expected'));
                    break;
                }
                $values[] = $itemHash;
            }
        }

        return $result;
    }