@param Value\ArrayValue $value

@return array<RequiredConstraint>
541587
protected function createRequiredConstraints(Value\ArrayValue $value)
    {
        $constraints = array();
        foreach ($value as $subValue) {
            $constraints[] = $this->createRequiredConstraint($subValue);
        }

        return $constraints;
    }
1011512
public function pull($value): AbstractArray
    {
        $value = $this->filterValue($value);
        if (is_null($value)) {
            return $this;
        }

        //Removing values from array (non strict)
        $this->values = array_filter($this->values, function ($item) use ($value) {
            return $item != $value;
        });

        $this->atomics['$pull']['$in'][] = $value;

        return $this;
    }
340940
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        $value = $this->currentValue();
        if (!$value instanceof Value\ArrayValue) {
            return $this->createResult();
        }

        $result = $this->createResult();
        $matchedIndices = array();

        // items
        foreach ($constraint->schemas() as $index => $schema) {
            if ($value->has($index)) {
                $matchedIndices[$index] = true;
                $result = $result->merge(
                    $this->validateArrayIndex($index, $schema)
                );
            } elseif (null !== $schema->defaultValue()) {
                $result = $result->merge(
                    $this->createResult(
                        array(),
                        array($this->createDefaultValueMatch($schema, $index))
                    )
                );
            }
        }

        // additional items
        foreach ($value->keys() as $index) {
            if (!array_key_exists($index, $matchedIndices)) {
                $result = $result->merge(
                    $this->validateArrayIndex(
                        $index,
                        $constraint->additionalSchema()
                    )
                );
            }
        }

        return $result;
    }
911863
public function validateToArray($value, $constraints = null, $groups = null)
    {
        return $this->formatViolationsToArray($this->validate($value, $constraints, $groups));
    }
342104
protected function normalizeArray(array $value)
    {
        array_walk($value, function(&$item) {
            if (is_object($item) || is_array($item)) {
                $item = var_export($item, true);
            }
        });

        return $value;
    }
431183
public function check($value, array $context = [])
    {
        if ($this->checkContainerType($value, $context) === false) {
            return false;
        }

        foreach ($value as $item) {
            if ($this->valueConstraint->check($item, $context) === false) {
                return false;
            }
        }

        return true;
    }
681209
protected function _constraints(array $constraints) {
		foreach ($constraints as &$value) {
			if (is_string($value)) {
				$value = (object) $this->name($value);
			} elseif (is_array($value)) {
				$value = $this->_constraints($value);
			}
		}
		return $constraints;
	}
44697
protected function procPropValue($value, array &$validPropertyValues)
    {
        // If the value is not a nested item
        if (!($value instanceof ValueInterface)) {
            throw new InvalidArgumentException(
                sprintf(InvalidArgumentException::INVALID_PROPERTY_VALUE_STR, gettype($value)),
                InvalidArgumentException::INVALID_PROPERTY_VALUE
            );
        }

        // If the value isn't empty
        if (!$value->isEmpty()) {
            $validPropertyValues[] = $value;
        }
    }
8728
public function apply(Value $value): array
    {
        $filter   = $this->filter;
        $errors   = [];
        $filtered = $filter($value, $errors);
        if (count($errors) > 0) {
            return $this->errors($errors);
        }

        return $this->filtered($filtered);
    }
659972
private function prepareValues($value): array
    {
        if (!self::hasMultipleValues($this->name)) {
            $values = is_array($value) ? $value : [trim($value)];
        } elseif (!is_array($value)) {
            $values = explode(',', (string) $value);
        } else {
            $values = $value;
        }

        foreach (array_keys($values) as $key) {
            $values[$key] = trim($values[$key]);

            if ($values[$key] == '') {
                unset($values[$key]);
            }
        }

        return array_values(array_unique($values));
    }
208072
protected function fixValue(array $value)/*# : array */
    {
        $result = [];
        foreach ($value as $k => $v) {
            if (false !== strpos($k, $this->field_splitter)) {
                $res = &$this->searchTree($k, $result, true);
                $res = is_array($v) ? $this->fixValue($v) : $v;
            } else {
                $result[$k] = is_array($v) ? $this->fixValue($v) : $v;
            }
        }
        return $result;
    }
401059
public function validate($value) : Result
    {
        return array_reduce(
            $this->restrictions,
            function ($result, $restriction) use ($value) : Result {
                if ($result->isFatal()) {
                    return $result;
                }

                return $result->concat($restriction($value));
            },
            Result::success()
        );
    }
904529
public function requireWith($value) {
        $this->check_role = 'require';
        $result = true;
        if ($value) {
            $result = !empty($this->value) || '0' == $this->value;
        }
        $this->checkResult($result);
    }
516165
public function visitItemsConstraint(ArrayValue\ItemsConstraint $constraint)
    {
        return new ArrayValue\ItemsConstraint(
            $this->transformConstraintArray($constraint->schemas()),
            $constraint->additionalSchema()->accept($this)
        );
    }
418413
protected function createMinimumConstraint(Value\ObjectValue $value)
    {
        if (!$value->has('minimum')) {
            return null;
        }

        return new NumberValue\MinimumConstraint(
            $value->getRaw('minimum'),
            $value->getRawDefault('exclusiveMinimum')
        );
    }
1288511
protected function validate(&$value)
    {
        if ($this->isNull($value)) {
            return $this;
        }

        if (!$this->isArray($value) && !$this->isArrayObject($value)) {
            $this->expected('array or ArrayObject', gettype($value));
        }

        // Call parent method
        parent::validate($value);

        // Validate array keys
        $this->validateNestedKeys($value);

        return $this;
    }
1175268
public function validate(
        string $path,
        $value,
        ValidatorContextInterface $context,
        ValidatorInterface $validator = null
    ) {
        if (null === $value) {
            return [];
        }

        if (!is_array($value) && !$value instanceof \Traversable) {
            return [new Error(
                $path.'[_all]',
                'constraint.all.invalidtype',
                ['type' => is_object($value) ? get_class($value) : gettype($value)]
            )];
        }

        $errors = [];
        foreach ($value as $i => $subValue) {
            foreach ($this->constraints as $constraint) {
                $errors = array_merge(
                    $errors,
                    $constraint->validate($path.'['.$i.']', $subValue, $context, $validator)
                );
            }
        }

        return $errors;
    }