Validates each one of the elements of the array against
its corresponding specified validator.

@param array $tuple

@return bool
322983
private function validateTuple(array $tuple)
    {
        $keys = array_keys($tuple);
        $count = count($this->items);
        for ($index = 0; $index < $count; $index++) {
            // In the specification is not clear what to do when instance size
            // is less than items size. I chose to pass null and if null passes
            // the validation, it returns true.
            $value = isset($keys[$index]) ? $tuple[$keys[$index]] : null;
            if (!$this->items[$index]->validate($value)) {
                return false;
            }
        }

        return true;
    }
1130519
private function preProcessTuple($tuple)
    {
        // Pre-format our tuple
        if ($tuple instanceof ParsedFileID) {
            return $tuple;
        } elseif (!is_array($tuple)) {
            throw new \InvalidArgumentException(
                'AssetAdapter expect $tuples to be an array or a ParsedFileID'
            );
        }

        return new ParsedFileID($tuple['Filename'], $tuple['Hash'], $tuple['Variant']);
    }
572258
public static function validate($value)
    {
        if (!is_array($value)) {
            return false;
        }
        if (!isset($value['from'])) {
            return false;
        }
        if (AddressValidator::validate($value['from']) === false) {
            return false;
        }
        if (isset($value['to']) && AddressValidator::validate($value['to']) === false && $value['to'] !== '') {
            return false;
        }
        if (isset($value['gas']) && QuantityValidator::validate($value['gas']) === false) {
            return false;
        }
        if (isset($value['gasPrice']) && QuantityValidator::validate($value['gasPrice']) === false) {
            return false;
        }
        if (isset($value['value']) && QuantityValidator::validate($value['value']) === false) {
            return false;
        }
        // if (!isset($value['data'])) {
        //     return false;
        // }
        // if (HexValidator::validate($value['data']) === false) {
        //     return false;
        // }
        if (isset($value['data']) && HexValidator::validate($value['data']) === false) {
            return false;
        }
        if (isset($value['nonce']) && QuantityValidator::validate($value['nonce']) === false) {
            return false;
        }
        return true;
    }
543796
public function validate($input): bool
    {
        if (!\is_array($input)) {
            return false;
        }
        $filtered = array_filter($input, $this->callback);
        return \count($input) === \count($filtered);
    }
1124881
protected function validateCode($code)
    {
        if (is_integer($code)) {
            return true;
        }

        // Plug it back in and see what we get
        if (is_string($code)) {
            return $this->set($code);
        }

        if (is_array($code)) {
            return $this->validateCodeArray($code);
        }

        return false;
    }
854470
private function __validate()
    {
        $blnReturn = true;

        foreach ($this->__elements as $element) {
            if (! $element->isValid()) {
                $blnReturn = false;
                break;
            }
        }

        return $blnReturn;
    }
1000692
private static function validateArray(array $object): bool
    {
        return (count($object) === 2)
            && (isset($object[0]))
            && (is_object($object[0]))
            && (isset($object[1]))
            && (is_string($object[1]))
            && ($object[0] instanceof $object[1]);
    }
147335
public function validate(&$errors = []) {
		if (!isset($this->type)) {
			$errors[] = 'type';
		}

		if (!isset($this->sender['email'])) {
			$errors[] = 'sender[email]';
		}

		if (!isset($this->recipients) or count($this->recipients) == 0) {
			$errors[] = 'recipients';
		}

		if (count($errors) == 0) {
			return true;
		} else {
			return false;
		}
	}
129595
public function validate(): bool
    {
        foreach ($this->_properties as $v) {
            if ($v instanceof SpecObjectInterface) {
                $v->validate();
            } elseif (is_array($v)) {
                foreach ($v as $item) {
                    if ($item instanceof SpecObjectInterface) {
                        $item->validate();
                    }
                }
            }
        }
        $this->performValidation();
        return \count($this->getErrors()) === 0;
    }
580390
function validate($options = [])
    {
        $groups = @$options['groups'] ?: [];

        $this->errors = static::validator()->validate($this, $groups);

        return $this->errors->count() === 0;
    }
801974
public function validate()
    {
        $matchers = [];

        // #1: find matchers.
        foreach ($this->getFluent()->getCalls() as $key) {
            // Keyword "not" inverses the end result.
            // Using it twice in the same assertion will have no effect (see the code).
            if ("not" == $key) {
                $this->inverse = true;

                continue;
            }

            if (is_array($key)) {
                // Handle "matcher+link+arguments" (instead of "matcher+arguments") cases.
                if (in_array($key[0], $this->links) and count($matchers) > 0) {
                    $lastIndex = count($matchers) - 1;
                    $matchers[$lastIndex] = [$matchers[$lastIndex], $key[1]];
                } else {
                    $matchers[] = $key;
                }

                continue;
            }

            // If the given keyword is NEITHER a link NOR "should", it must be a matcher name.
            if ( ! in_array($key, $this->links) && "should" != $key) {
                $matchers[] = $key;
            }
        }

        // If no matchers were found, just return "true" (there is no way it can be "false").
        if (count($matchers) == 0) {
            return true;
        }

        // Think of "{{link}}(smth)" as "equal(smth)".
        if (is_array($matchers[0]) and in_array($matchers[0][0], $this->links)) {
            $matchers[0][0] = "equal";
        }

        // #2: initialize the matchers.
        foreach ($matchers as $key => $matcher) {
            $class = $this->aliasToMatcher(is_array($matcher) ? $matcher[0] : $matcher);

            if ( ! class_exists($class)) {
                throw new Exceptions\NoMatcherFoundException($class);
            }

            $matchers[$key] = new $class(
                // @codeCoverageIgnoreStart
                $this->value, // The value we're working with.
                (is_array($matcher) ? $matcher[1] : []), // The matcher arguments.
                // Whether it should be in "configuration" or "normal" mode.
                (count($matchers) - 1 != $key) && count($matchers) != 1
            );
            // @codeCoverageIgnoreEnd
        }

        $result = true;

        // #3: run the matchers!
        foreach ($matchers as $matcher) {
            $this->lastMatcher = $matcher;

            if ( ! $matcher->run()) {
                $this->message = $matcher->getMessage();
                $result = false;

                break;
            }

            // We want to grab the message anyway.
            $this->message = $matcher->getMessage();
        }

        // #4: if the result should be inversed, do it.
        if ($this->inverse) {
            $this->inverse = false;
            $result = ! $result;

            $this->message = "NOT keyword (failed): ".$this->message;
        }

        return $result;
    }
605217
public function parse(array $input): bool
    {
        $this->resetAggregators();

        $this
            ->validateType($input)
            ->validateId($input)
            ->validateAttributes($input)
            ->validateRelationships($input);

        $hasNoErrors = $this->getJsonApiErrorCollection()->count() <= 0;

        return $hasNoErrors;
    }
822203
public function validate(array $attributes)
    {
        $table     = $this->model->getTable();
        $locale    = array_get($attributes, 'locale', '');
        $namespace = array_get($attributes, 'namespace', '');
        $group     = array_get($attributes, 'group', '');
        $rules     = [
            'locale'    => 'required',
            'namespace' => 'required',
            'group'     => 'required',
            'item'      => "required|unique:{$table},item,NULL,id,locale,{$locale},namespace,{$namespace},group,{$group}",
            'text'      => '', // Translations may be empty
        ];
        $validator = $this->app['validator']->make($attributes, $rules);
        if ($validator->fails()) {
            $this->errors = $validator->errors();
            return false;
        }
        return true;
    }
989076
public function validate(array $input): bool
    {
        // Grab input fields and define the rules for user validations.
        $rules = [
            'email' => ['required', 'email'],
            'password' => ['required'],
            'fullname' => ['required'],
            'site_name' => ['required'],
        ];

        $validation = \app('validator')->make($input, $rules);

        // Validate user registration, we should stop this process if
        // the user not properly formatted.
        if ($validation->fails()) {
            throw new ValidationException($validation);
        }

        return true;
    }
1173369
protected function validateCodeArray(array $codes)
    {
        // Loop through it and add each of the properties
        $adds = [];

        foreach ($codes as $code) {
            $adds[] = $this->set($code);
        }

        // If any of them came back true, we're good to go
        return in_array(true, $adds);
    }
984764
public function validate(array $credentials = [])
    {
        if (empty($credentials[$this->inputKey])) {
            return false;
        }

        $credentials = [$this->storageKey => $credentials[$this->inputKey]];

        if ($this->provider->retrieveByCredentials($credentials)) {
            return true;
        }

        return false;
    }
382363
public function validate(array $fields)
    {
        $this->flashInput($fields);

        $rules = $this->getValidationRules($fields);

        $validator = $this->getValidatorInstance($rules);

        if($validator->fails()){

            $this->failedValidation($validator);
        }
    }