Checks if the value is valid according to the enumeration.

@param mixed $value
@return bool
@throws \RuntimeException
771704
public static function isValid($value)
    {
        if (__CLASS__ === get_called_class()) {
            throw new \RuntimeException('Cannot call isValid() on ' . __CLASS__);
        }

        $reflectionClass = new \ReflectionClass(get_called_class());
        $validValues = $reflectionClass->getConstants();

        if (static::isBitFlag()) {
            $bitFlagAllOn = 0;

            foreach ($validValues as $validValue) {
                $bitFlagAllOn |= $validValue;
            }

            return ($value | $bitFlagAllOn) === $bitFlagAllOn;
        }

        return in_array($value, $validValues, true);
    }
917290
public function containsValue($value): bool {
        TypeHelper::validateValue($value, $this);
        foreach ($this as $v) {
            if ($value == $v) {
                return true;
            }
        }

        return false;
    }
527192
public function isValid($value)
    {
        $this->databaseError = null;

        // @codeCoverageIgnoreStart
        // This cannot be testes until we have a test database environment.
        try {
            $connection = new Client($value);
            $connection->listDatabases();
        } catch (ConnectionTimeoutException $e) {
            $this->databaseError = $e->getMessage();
            $this->error(self::NO_CONNECTION);
            return false;
        } catch (\Exception $e) {
            $this->databaseError = $e->getMessage();
            $this->error(self::NO_CONNECTION);
            return false;
        }

        return true;
        // @codeCoverageIgnoreEnd
    }
505458
public function isValid($value) : bool
    {
        if ($value === null && $this->nullable) {
            return true;
        }

        return $value instanceof Metadata;
    }
984889
public function isValid($value)
    {
        $this->setValue($value);

        $check = $this->pageRepo->findOneBy(
            [
                'pageId' => $value,
                'pageType' => $this->pageType,
                'site' => $this->site
            ]
        );

        if (empty($check)) {
            $this->error(self::PAGE_TEMPLATE);

            return false;
        }

        return true;
    }
132956
public function validateValue( $value ) : bool
   {

      if ( false === $this->hasValidator() )
      {
         return true;
      }

      return (bool) ( $this->_validator )( $value );

   }
1060467
public function isValueValid($value) {
		return $value instanceof Type\ListItemType || $value instanceof DataType\TextType || $value instanceof Type\ThingType;
	}
634797
public function isValueValid($value) {
		return $value instanceof Type\DistanceType || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
1257041
public function isValueValid($value) {
		return $value instanceof Type\CreativeWork || $value instanceof Type\HowToSection || $value instanceof Type\HowToStep || $value instanceof DataType\TextType;
	}
464012
public function isValid($value)
    {
        if (!is_string($value) && !is_int($value) && !is_float($value)) {
            $this->_error(self::INVALID);
            return false;
        }

        if (is_int($value)) {
            return true;
        }

        $this->_setValue($value);
        if ($this->_locale === null) {
            $locale        = localeconv();
            $valueFiltered = str_replace($locale['decimal_point'], '.', $value);
            $valueFiltered = str_replace($locale['thousands_sep'], '', $valueFiltered);

            if (strval(intval($valueFiltered)) != $valueFiltered) {
                $this->_error(self::NOT_INT);
                return false;
            }

        } else {
            try {
                if (!Zend_Locale_Format::isInteger($value, array('locale' => $this->_locale))) {
                    $this->_error(self::NOT_INT);
                    return false;
                }
            } catch (Zend_Locale_Exception $e) {
                $this->_error(self::NOT_INT);
                return false;
            }
        }

        return true;
    }
186143
public function isValueValid($value) {
		return $value instanceof Type\AlignmentObjectType || $value instanceof Type\CourseType || $value instanceof DataType\TextType;
	}
88742
public function isAssignableFromValue($value)
    {
        switch ($this->name)
        {
            case self::INTEGER_NAME:
                return is_int($value);
            case self::FLOAT_NAME:
                return is_float($value);
            case self::STRING_NAME:
                return is_string($value);
            case self::BOOLEAN_NAME:
                return is_bool($value);
            case self::MIXED_NAME:
                return true;
            case self::RESOURCE_NAME:
                return is_resource($value);
            case self::OBJECT_NAME:
                return is_object($value);
            case self::NULL_NAME:
                return is_null($value);
            case self::CALLABLE_NAME:
                return is_callable($value);
            default:
                throw new Exception("Implementation error");
        }
    }
977329
public function isValid($value)
    {
        foreach ($this->typeNodes as $typeNode) {
            if ($typeNode->isValid($value)) {
                return true;
            }
        }

        return false;
    }
534753
protected function validate($value)
    {
        if (!$this->validators instanceof IValidatorCollection) {
            return true;
        }

        $isValid = $this->validators->isValid($value);
        $this->messages = $this->validators->getMessages();

        return $isValid;
    }
787118
protected function isValid($value)
    {
        $value = (string) $value;
        foreach (static::$enumConstants[get_class($this)] as $constantValue) {
            if ($value === (string) $constantValue) {
                return true;
            }
        }
        return false;
    }
570722
public function isValid($value)
    {
        foreach ((array) $value as $val) {
            if (\MUtil_String::contains($val, $this->_options[0])) {
                return true;
            }
        }
        return false;
    }
698285
public function isValueValid($value) {
		return $value instanceof DataType\TextType || $value instanceof Type\Thing || $value instanceof DataType\URLType;
	}