@param array $specification

@throws \Mcustiel\SimpleRequest\Exception\UnspecifiedValidatorException
423317
private function initPatternProperties(array $specification)
    {
        if (isset($specification[self::PATTERN_PROPERTIES_INDEX])) {
            $this->setPatternProperties($specification[self::PATTERN_PROPERTIES_INDEX]);
        }
    }
892966
private function validate($decoded): void
    {
        // Validate it is an array
        if (! Validator::arrayType()->length(2, 2)->validate($decoded)) {
            throw new AnnotationParseException(
                '"mock" annotation content is invalid (must contains the class to mock and the property name)'
            );
        }
        // Validate that each value is a string
        if (! Validator::arrayVal()->each(Validator::stringType(), Validator::intType())->validate($decoded)) {
            throw new AnnotationParseException(
                '"mock" annotation content is invalid (class and property name must be string)'
            );
        }
    }
810644
static function checkAnyRequiredParameter(array $given, array $required)
    {
        try {
            
            foreach ($required as $key) {
                if (!empty($given[$key])) {
                    throw new RequiredParameterFound();
                }
            }
            
            $parameters = implode(', ', $required);
            throw new MissingRequiredParameterException(
                    "At least one parameter required: $parameters"
            );
            
        } catch (RequiredParameterFound $ex) {
            // we have one required parameter, thats all we need
        }
    }
1309905
public function setSpecification($specification = null)
    {
        $this->checkSpecificationIsArray($specification);

        $this->initProperties($specification);
        $this->initPatternProperties($specification);
        $this->initAdditionalProperties($specification);
    }
402987
public function match(SpecificationInterface $specification, ModifierInterface $modifier = null)
    {
        if (! $specification->isSatisfiedBy($this->getEntityName())) {
            throw new LogicException(sprintf(
                'Specification "%s" not supported by this repository!',
                get_class($specification)
            ));
        }

        $queryBuilder = $this->createQueryBuilder($this->dqlAlias);
        $this->modifyQueryBuilder($queryBuilder, $specification);

        return $this->modifyQuery($queryBuilder, $modifier);
    }
304020
private function validate($decoded): void
    {
        // Validate it is an array
        if (! Validator::arrayType()->length(1, 2)->validate($decoded)) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (must contains parameters array, and maybe a class)'
            );
        }

        $size = count($decoded);

        // Validate that if size is 2, first value is a string
        if ($size === 2 && ! Validator::stringType()->validate($decoded[0])) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (constructor class must be a string)'
            );
        }
        // Validate that last value is an array
        if (! Validator::arrayVal()
            ->each(Validator::stringType(), Validator::intType())->validate($decoded[$size - 1])) {
            throw new AnnotationParseException(
                '"construct" annotation content is invalid (constructor parameters must be a array of string)'
            );
        }
    }
981861
public function setPost($spec, $value = null)
    {
        if ((null === $value) && !is_array($spec)) {
            throw new \Exception('Invalid value passed to setPost(); must be either array of values or key/value pair');
        }

        if ((null === $value) && is_array($spec)) {
            foreach ($spec as $key => $value) {
                $this->setPost($key, $value);
            }
            return $this;
        }

        $_POST[(string) $spec] = $value;
        return $this;
    }
859231
public function validateSpecific(array $required = [])
    {
        foreach ($required as $field) {
            /*
             * If the field is in the required array, and the
             * object attribute equals null, we'll throw an exception.
             */
            if (in_array($field, $this->required) && $this->getAttribute($field) === null) {
                throw new AdldapException(sprintf($this->messages['required'], $field));
            }
        }

        return true;
    }
757303
function validateService($pluginInstance)
    {
        if (!is_object($pluginInstance))
            throw new \Exception(sprintf('Can`t resolve to (%s) Instance.', $pluginInstance));

        if (!$pluginInstance instanceof iAuthenticator)
            throw new exContainerInvalidServiceType('Invalid Plugin Of Content Object Provided.');

    }
926593
public function validateValidatorConfiguration($validatorConfiguration)
    {
        $validationErrors = array();

        foreach ($validatorConfiguration as $validatorIdentifier => $constraints) {
            if ($validatorIdentifier !== 'FloatValueValidator') {
                $validationErrors[] = new ValidationError(
                    "Validator '%validator%' is unknown",
                    null,
                    array(
                        '%validator%' => $validatorIdentifier,
                    ),
                    "[$validatorIdentifier]"
                );

                continue;
            }

            foreach ($constraints as $name => $value) {
                switch ($name) {
                    case 'minFloatValue':
                    case 'maxFloatValue':
                        if ($value !== null && !is_numeric($value)) {
                            $validationErrors[] = new ValidationError(
                                "Validator parameter '%parameter%' value must be of numeric type",
                                null,
                                array(
                                    '%parameter%' => $name,
                                ),
                                "[$validatorIdentifier][$name]"
                            );
                        }
                        break;
                    default:
                        $validationErrors[] = new ValidationError(
                            "Validator parameter '%parameter%' is unknown",
                            null,
                            array(
                                '%parameter%' => $name,
                            ),
                            "[$validatorIdentifier][$name]"
                        );
                }
            }
        }

        return $validationErrors;
    }
1316535
private function setRequirements(array $requirements)
    {
        $requirements = $this->filterRequirements($requirements);

        $this->requirements = $this->hasParent() ?
            array_merge($this->parent->getRequirements(), $requirements) :
            $requirements;
    }
1138315
protected function validate(array $data)
    {
        $validator = Validator::make($data, $this->rules);

        if ($validator->fails()) {
            throw new FormValidationException(trans('dashboard::dashboard.errors.form.validation'), $validator);
        }
    }
1278449
private function isValidQuickReplies(array $quickReplies): void
    {
        $this->isValidArray($quickReplies, 11, 1);
        foreach ($quickReplies as $quickReply) {
            if (!$quickReply instanceof QuickReply) {
                throw new InvalidClassException(sprintf(
                    'Array can only contain instance of %s.',
                    QuickReply::class
                ));
            }
        }
    }
270340
private function isValidElements(array $elements): void
    {
        $this->isValidArray($elements, 1, 1);
        foreach ($elements as $element) {
            if (!$element instanceof MediaElement) {
                throw new InvalidClassException(sprintf('Array can only contain instance of %s.', MediaElement::class));
            }
        }
    }
1176747
private function initializeValidator($form)
    {
        if (false === $form instanceof FormInterface) {
            throw InvalidArgumentTypeException::validatingWrongFormType(get_class($form));
        }

        $this->form = $form;
        $this->result = new FormResult;
        $this->formValidatorExecutor = $this->getFormValidatorExecutor($form);
    }
98108
protected function validateCommands(array $configuration)
    {
        foreach ($configuration[static::SECTIONS] as $sectionName => $commands) {
            if ($commands === null || count($commands) === 0) {
                throw new ConfigurationException(sprintf('No commands defined in section "%s".', $sectionName));
            }
        }
    }
1213244
final public function whereHasAny(string $collectionMemberExpression, ISpecification $specification)
    {
        return $this->where($collectionMemberExpression, ConditionOperator::ANY_SATISFIES, $specification);
    }