Validate a value

@param   mixed  $value Value to be validated
@return  bool    True when the variable is valid
722
public function validate($value)
    {
        $result = false;

        if (is_string($value) && strlen($value))
        {
            if ($value[0] == '/' || $value[0] == '\\'
                || (strlen($value) > 3 && ctype_alpha($value[0])
                    && $value[1] == ':'
                    && ($value[2] == '\\' || $value[2] == '/')
                )
                || null !== parse_url($value, PHP_URL_SCHEME)
            ) {
                $result = true;
            }
        }

        return $result;
    }
1183522
public function validate($value)
    {
        if (!$this->test($value)) {
            // TODO: Use exception after 4.0
            $this->setError($this->formatMessage($this->getMessage(), $value));

            return false;
        }

        return true;
    }
507361
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = ComHashtagsDomainEntityHashtag::PATTERN_HASHTAG;

        return (is_string($value) && (preg_match($pattern, $value)) == 1);
    }
855694
public function isValid($value)
    {
        foreach ($this as $type) {
            if ($type->isValid($value)) {
                return true;
            }
        }

        return false;
    }
815840
public function isValid($value)
    {
        if (('js-' . self::generateCrc() . '-js') == $value) {
            return true;
        }
        return $this->_error(self::INVALID);
    }
939899
public function isValueValid($value) {
		return $value instanceof DataType\NumberType || $value instanceof Type\QuantitativeValueType || $value instanceof DataType\TextType;
	}
1319912
public function isValid($value)
    {
        $valueString = (string) $value;

        $this->_setValue($valueString);

        if (ip2long($valueString) === false) {
            $this->_error();
            return false;
        }

        return true;
    }
132530
public function isValid($value)
    {
        if (!is_null($value) && !is_string($value) && !is_int($value) && !is_float($value) &&
            !is_bool($value) && !is_array($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        if (is_string($value) && (('' === $value) || preg_match('/^\s+$/s', $value))) {
            $this->_error(self::INVALID);
            return false;
        } elseif (is_int($value) && (0 === $value)) {
            return true;
        } elseif (!is_string($value) && empty($value)) {
            $this->_error(self::INVALID);
            return false;
        }
        return true;
    }
336688
public function validate($value)
    {
        $value = trim($value);
        return ((string) $value === $this->sanitize($value));
    }
1000801
public function isValueValid($value) {
		return $value instanceof Type\Distance || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
121216
public static function isValid($value)
    {
        if (!is_string($value)) {
            return false;
        }

        $type = self::getType($value);

        return !($type === null);
    }
1040353
public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);
        $result = @preg_match(self::LASTMOD_REGEX, $value);
        if ($result != 1) {
            $this->_error(self::NOT_VALID);
            return false;
        }

        return true;
    }
93488
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = '/\pL|[.#@_\s-0-9]/u';

        return is_string($value) && preg_replace($pattern, '', $value);
    }
728948
public function isValid($value)
    {
        if (!is_string($value)
            && !($value instanceof Uuid) // If instance of Uuid still does not means that is valid
        ) {
            $this->error(self::INVALID);
            return false;
        }

        $this->setValue($value);

        if (!preg_match('/^' . self::UUID_V4_PATTERN . '$/', $value)) {
            $this->error(self::NOT_UUID_V4);
            return false;
        }

        return true;
    }
1335174
public function isValid($value)
    {
        $valueString = (string) $value;

        $this->_setValue($valueString);

        if ((ip2long($valueString) === false) || (long2ip(ip2long($valueString)) !== $valueString)) {
            if (!function_exists('inet_pton')) {
                $this->_error();
                return false;
            } else if ((@inet_pton($value) === false) ||(inet_ntop(@inet_pton($value)) !== $valueString)) {
                $this->_error();
                return false;
            }
        }

        return true;
    }
1260685
public function isValid($value)
    {
        $ok = true;
        
        if (!preg_match('/^[0-9]+(\.[0-9]+)?$/', $value)) {
            $this->error(self::SYNTAX);
            return false;
        }
        
        if ($value < $this->options['min']) {
            $this->error(self::MIN);
            $ok = false;
        }
        
        if ($value > $this->options['max']) {
            $this->error(self::MAX);
            $ok = false;
        }
        
        $parts = explode('.', $value);
        if (isset($parts[1]) && strlen($parts[1]) > $this->options['precision']) {
            if ($this->options['precision']) {
                $this->error(self::PRECISION);
            } else {
                $this->error(self::NO_COMMA);
            }
            $ok = false;
        }

        return $ok;
    }
711071
public function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }

        return $value / $this->number == round($value / $this->number);
    }