Validate a value

@param    mixed  $value Value to be validated
@return   bool   True when the variable is valid
555019
public function validate($value)
    {
        try {
            $config = $this->getObject('object.config.factory')->fromString('ini', $value);
        } catch(\RuntimeException $e) {
            $config = null;
        }

        return is_string($value) && !is_null($config);
    }
408918
public function validate($value = "")
    {
        if (is_null($value) && $this->isEmptyAllowed()) {
            return true;
        }

        if ($this->isNullNotAllowed() && is_null($value)) {
            return false;
        }

        return true;
    }
1170195
public function isValid($value)
    {
        if (!preg_match('/^\+?[0-9]{2,12}$/', $value)) {
            $this->error(self::BAD_SYNTAX);
            return false;
        }
        
        return true;
    }
662503
public function isValid($value)
    {
        if (!is_string($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        $this->_setValue($value);

        if ('' === $value) {
            $this->_error(self::STRING_EMPTY);
            return false;
        }

        if (null === self::$_filter) {
            /**
             * @see Zend_Filter_Alpha
             */

            self::$_filter = new Zend_Filter_Alpha();
        }

        self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;

        if ($value !== self::$_filter->filter($value)) {
            $this->_error(self::NOT_ALPHA);
            return false;
        }

        return true;
    }
683858
public function isValueValid($value) {
		return $value instanceof DataType\BooleanType || $value instanceof DataType\TextType || $value instanceof DataType\URLType;
	}
507361
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = ComHashtagsDomainEntityHashtag::PATTERN_HASHTAG;

        return (is_string($value) && (preg_match($pattern, $value)) == 1);
    }
189370
public function validate($value)
    {
        if (!(is_array($value) || $value instanceof \stdClass)) {
            return false;
        }

        return $this->executePropertiesValidation($this->convertToArray($value));
    }
26487
public function isValid($value)
    {
        $messages = [];
        $valid = true;
        foreach ($this->_validators as $validator) {
            if (!$validator->validates($value)) {
                $valid = false;
                $messages[] = $validator->getMessage();
            }
        }
        $this->_messages = $messages;
        return $valid;
    }
711071
public function validate($value)
    {
        if (!is_numeric($value)) {
            return false;
        }

        return $value / $this->number == round($value / $this->number);
    }
1193963
public function isValid($value)
    {
        $valueString = (string) $value;

        $this->_setValue($valueString);

        if ('' === $valueString) {
            $this->_error(self::STRING_EMPTY);
            return false;
        }

        if (null === self::$_filter) {
            /**
             * @see Zend_Filter_Digits
             */
            require_once 'Zend/Filter/Digits.php';
            self::$_filter = new Zend_Filter_Digits();
        }

        if ($valueString !== self::$_filter->filter($valueString)) {
            $this->_error(self::NOT_DIGITS);
            return false;
        }

        return true;
    }
855694
public function isValid($value)
    {
        foreach ($this as $type) {
            if ($type->isValid($value)) {
                return true;
            }
        }

        return false;
    }
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;
    }
336688
public function validate($value)
    {
        $value = trim($value);
        return ((string) $value === $this->sanitize($value));
    }
588690
public function validate($value)
    {
        $this->pushResult();
        if ($this->acceptsEmptyValues === false || $this->isEmpty($value) === false) {
            $this->isValid($value);
        }
        return $this->popResult();
    }
1145374
protected function _validate($value)
    {
        $value = trim($value);
        $pattern = '/^[a-f0-9]{32}$/';
        return (is_string($value) && preg_match($pattern, $value) == 1);
    }
1319912
public function isValid($value)
    {
        $valueString = (string) $value;

        $this->_setValue($valueString);

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

        return true;
    }
291925
public function isValid($value)
    {
        if (!filter_var($value, $this->getFilter(), $this->getOption())) {
            $this->_error($this->getMessageKey(), $value);
            return false;
        }

        return true;
    }