Look at the validator list.
@param	array	$input	All input parameters that were passed to `filter()`.
@param	mixed	$value	The input data to validate.
@param	integer	$width	The width the image must have.
@return 	booolean	The result of the validation.
197780
protected function _validator_width($input, $value, $width) {
		if (!is_string($value)) return false;

		try {
			$imagesize = getimagesize($value);
			if ($imagesize[0] == $width) return true;
			return false;
		} catch (\Exception $e) {
			return false;
		}
		return false;
	}
1126986
public function validate($input): bool
    {
        return $this->less($this->minValue, $input)
            && $this->less($input, $this->maxValue);
    }
524427
public function validate( $input )
    {
        // Check if we got readaccess to the provided file name at all.
        if ( !is_file( $input ) || !is_readable( $input ) )
        {
            throw new phpillowRuntimeException( 'Given image file not found: ' . $input );
        }

        // Use getimagesize to determine the filetype of the image, and compare
        // with whitelist of supported image formats.
        $imageData = getimagesize( $input );
        if ( ( $imageData === false ) ||
             ( !in_array( $imageData[2], $this->supportedImageFormats ) ) )
        {
            throw new phpillowValidationException( 'Unsupported image format provided.', array() );
        }

        // If all checks passed, we assume that this is a proper image file.
        return $input;
    }
450176
public function validate($input): bool
    {
        if (!$length = $this->extractLength($input)) {
            return false;
        }

        return (null === $this->minValue || $this->less($this->minValue, $length))
            && (null === $this->maxValue || $this->less($length, $this->maxValue));
    }
1259311
public function validate($value)
    {
        //Use string's validator
        $return = parent::validate($value);

        //Apply additional rules
        if ($return->status == true) {
            if (filter_var($value, FILTER_VALIDATE_URL) === false) {
                //error
                $return->status = false;
                $return->errorObject = new IncorrectParametersException([
                    [
                        'type' => static::getType(),
                        'failure' => 'format'
                    ]
                ]);
            }
        }

        return $return;
    }
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;
    }
109324
public function validate($input): bool
    {
        // for array
        if (\is_array($input)) {
            return \in_array($this->containsValue, $input, false);
        }
        // for string
        if (\is_string($input)) {
            return false !== mb_stripos($input, $this->containsValue, 0, mb_detect_encoding($input));
        }
        // can't compare
        return false;
    }
1321255
public function validate($value, &$filtered = null)
    {
        if (!$this->validator->validate($value, $filtered))
            throw new ValidationException($this->validator->getErrorMessage($value));

        return true;
    }
569951
public function validate( $input )
    {
        // Check for minimum constraint
        if ( ( $this->min !== false ) &&
             ( $input < $this->min ) )
        {
            throw new phpillowValidationException(
                'Input value %input is not bigger or equal then %minimum.',
                array(
                    'input'   => $input,
                    'minimum' => $this->min,
                )
            );
        }

        // Check for maximum constraint
        if ( ( $this->max !== false ) &&
             ( $input > $this->max ) )
        {
            throw new phpillowValidationException(
                'Input value %input is not lesser or equal then %maximum.',
                array(
                    'input'   => $input,
                    'maximum' => $this->max,
                )
            );
        }

        return (float) $input;
    }
1248034
protected function validateBoolean($value, ValidationField $field) {
        $value = $value === null ? $value : filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
        if ($value === null) {
            $field->addTypeError($value, 'boolean');
            return Invalid::value();
        }

        return $value;
    }
226440
public function validate(array $inputs, array $rules)
    {
        $this->inputs = $inputs;

        foreach ($rules as $key => $rule) {
            /**
             * Formatting and validation of each rule
             * eg. name => "required|max:100|alpha"
             */
            foreach (explode("|", $rule) as $masque) {
                // In the box there is a | superflux.
                if (is_int($masque) || Str::len($masque) == "") {
                    continue;
                }

                // Error lists.
                $this->errors[$key] = [];

                // Mask on the required rule
                foreach ($this->compiles as $compile) {
                    $this->{'compile'.$compile}($key, $masque);
                }

                // We clean the list of errors if the key is valid
                if (empty($this->errors[$key])) {
                    unset($this->errors[$key]);
                }
            }
        }

        return new Validate(
            $this->fails,
            $this->last_message,
            $this->errors
        );
    }
275493
function validate($value, $options = null) {
        global $CFG;
        if (is_array($value) && array_key_exists('text', $value)) {
            $value = $value['text'];
        }
        if (is_array($value)) {
            // nasty guess - there has to be something in the array, hopefully nobody invents arrays in arrays
            $value = implode('', $value);
        }
        $stripvalues = array(
            '#</?(?!img|canvas|hr).*?>#im', // all tags except img, canvas and hr
            '#(\xc2\xa0|\s|&nbsp;)#', // Any whitespaces actually.
        );
        if (!empty($CFG->strictformsrequired)) {
            $value = preg_replace($stripvalues, '', (string)$value);
        }
        if ((string)$value == '') {
            return false;
        }
        return true;
    }
1306536
protected function _validator_regex($input, $value, $regex) {
		if (!is_string($value) && !is_integer($value) && !is_float($value)) return false;
		if (!preg_match($regex, $value)) return false;
		return true;
	}
870509
public function validate( $input )
    {
        $uuidv4Pattern = '(^([0-9a-fA-F]{8})-?([0-9a-fA-F]{4})-?(4[0-9a-fA-F]{3})-?([89abAB][0-9a-fA-F]{3})-?([0-9a-fA-F]{12})$)';
        if ( preg_match( $uuidv4Pattern, $input, $matches ) !== 1 ) 
        {
            throw new phpillowValidationException( 
                'A uuid version 4 is required. Something else has been given.',
                array()
            );
        }

        return strtolower( 
            $matches[1] . '-' . $matches[2] . '-' . $matches[3] . '-' . $matches[4] . '-' . $matches[5]
        );
    }
684456
public function check($input)
    {
        if ($this->lazy) {
            $this->lazy = false;
            $this->parseDefinition();
        }
        $this->lastValue = $input;
        if (strlen($input) === 0 && $this->skipEmpty) {
            return true;
        }
        $constraint = $this->constraint;
        return $constraint($input, $this, $this->attrib, $this->dataFilter);
    }
1249090
private function resolve($value): Input
    {
        $rules = $this->queueOfRules->toArray();
        $input = Input::make($value);

        foreach ($rules as $rule) {
            $input = $rule->execute($input);
        }

        $input = $this->applyTypeValidation($input);

        return $input;
    }
636881
public function validate($value)
    {
        // The value which comes in is a files array so we can look through this
        // to and then get the files to test aspects of them.
        if (isset($value['Files'])) {
            foreach($value['Files'] as $fileID) {
                $file = File::get()->byId($fileID);

                // Now have the file double-check it is an image and if so then
                // get some information about the image using PHPs getimagesize()
                if ($file->ClassName == 'Image') {
                    $info = getimagesize(BASE_PATH . "/" . $file->Filename);

                    if ($info && is_array($info)) {
                        $width = $info[0];
                        $height = $info[1];

                        switch ($this->type) {
                            case self::WIDTH:
                                return $width == $this->val1;
                                break;
                            case self::HEIGHT:
                                return $height == $this->val1;
                                break;
                            case self::WIDTH_HEIGHT:
                                return (($width == $this->val1) && ($height == $this->val2));
                                break;
                            case self::RATIO:
                                $baseWidth = floor($width / $this->val1);
                                $baseHeight = floor($height / $this->val2);
                                return $baseWidth == $baseHeight;
                                break;
                            case self::MIN_WIDTH:
                                return $width >= $this->val1;
                                break;
                            case self::MIN_HEIGHT:
                                return $height >= $this->val1;
                                break;
                            case self::MIN_WIDTH_HEIGHT:
                                return (($width >= $this->val1) && ($height >= $this->val2));
                                break;
                            case self::MAX_WIDTH:
                                return $width <= $this->val1;
                                break;
                            case self::MAX_HEIGHT:
                                return $height <= $this->val1;
                                break;
                            case self::MAX_WIDTH_HEIGHT:
                                return (($width <= $this->val1) && ($height <= $this->val2));
                                break;
                            default:
                                throw new Exception('Invalid type : ' . $this->type);
                        }
                    }
                }
            }
        } else {
            // Return true so if no file selected then not shown validation message
            // when the field is optional. If required dev should add to required fields as well.
            return true;
        }
    }