Checks if given value is valid for this enum class.

@param mixed $value A value to check
@param bool $strict If strict comparison should be used or not
@return boolean True of value is valid, false otherwise
765623
public static function isValidValue($value, $strict = true) : bool
    {
        $values = array_values(self::getConstants());
        return in_array($value, $values, $strict);
    }
485466
public function _validation_match_value($val, $compare, $strict = false)
	{
		// first try direct match
		if ($this->_empty($val) || $val === $compare || ( ! $strict && $val == $compare))
		{
			return true;
		}

		// allow multiple input for comparison
		if (is_array($compare))
		{
			foreach($compare as $c)
			{
				if ($val === $c || ( ! $strict && $val == $c))
				{
					return true;
				}
			}
		}

		// all is lost, return failure
		return false;
	}
126182
public function normalize($value)
    {
        if (is_null($value) || $value === '') {
            return;
        }
        if (is_bool($value)) {
            return $value;
        }

        if ($value === $this->valueTrue) {
            return true;
        }

        if ($value === $this->valueFalse) {
            return false;
        }

        if (is_numeric($value)) {
            return (bool) $value;
        }

        throw new ValidationException([$this->name => 'Must be a boolean value']);
    }
360209
public function remove($value, $strict = false)
    {
        while ($index = $this->search($value, $strict)) {
            $this->delete($index);
        }

        return $this;
    }
895909
public function contains($value, $key = null, $strict = false)
    {
        if ($key !== null) {
            foreach ($this->items as $item) {
                $v = isset($item[$key]) ? $item[$key] : null;
                if ((!$strict && $v == $value) || $v === $value) {
                    return true;
                }
            }
            return false;
        }

        if ($this->useAsCallable($value)) {
            return $this->first($value) !== null;
        }

        return in_array($value, $this->items, $strict);
    }
961087
public function match($value, string $field, bool $strict = false): bool
    {
        if ($strict) {
            return $value === $this->getValidator()->getValue($field, null);
        }

        return $value == $this->getValidator()->getValue($field, null);
    }
645934
public function isValid( $name, $value = null )
    {
        if( !isset( $this->enums[$name] ) ) {
            return false;
        } elseif( $value === null ) {
            return true;
        }
        return !isset( $value ) || in_array( $value, $this->enums[$name] );
    }
1278793
public function where($key, $value, $strict = true)
    {
        return $this->filter(function ($item) use ($key, $value, $strict)
        {
            return ($strict ? (data_get($item, $key) === $value) : (data_get($item, $key) == $value));
        });
    }
505479
public function contains($value, $strict = TRUE)
    {
        return $this->containsIn($value, $strict, $this->all());
    }
416494
public function matches($value, $strict = true)
    {
        return $strict ? $this->value === $value : $this->value == $value;
    }
761017
public function contains($value, bool $strict = false): bool
    {
        return (bool) in_array($this->storage, $value, $strict);
    }
409299
public static function isUUID($value, $strict = true)
    {
        \settype($value, 'string');

        $pattern = '/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/i';
        if (true !== $strict) {
            $value   = \trim($value, '[]{}');
            $pattern = '/^[a-f0-9]{4}(?:-?[a-f0-9]{4}){7}$/i';
        }

        return \preg_match($pattern, $value) > 0;
    }
304446
public function contains($value, bool $strict = true): bool
    {
        return in_array($value, $this->items, $strict);
    }
634797
public function isValueValid($value) {
		return $value instanceof Type\DistanceType || $value instanceof DataType\NumberType || $value instanceof DataType\TextType;
	}
1229004
public function isValid($value)
    {
        try {
            if (null === \json_decode($value, true)) {
                return $this->_error(self::INVALID);
            }
        } catch (\Exception $e) {
            return $this->_error(self::INVALID);
        }
        return true;
    }
465368
public function isValueValid($value) {
		return $value instanceof Type\EnumerationType || $value instanceof Type\PropertyValueType || $value instanceof Type\QualitativeValueType || $value instanceof Type\QuantitativeValueType || $value instanceof Type\StructuredValueType;
	}
360606
protected function isValidValue($value)
    {
        $valid = true;
        if (is_array($value)) {
            $numericKeys = 0;
            foreach ($value as $k => $v) {
                $numericKeys += is_integer($k);
                if (!$this->isValidValue($v)) {
                    $valid = false;
                    break;
                }
            }
            if (!($numericKeys == 0 || $numericKeys == count($value))) {
                $valid = false;
            }
        } else {
            if (null !== $value && !is_scalar($value)) {
                $valid = false;
            }
        }
        return $valid;
    }