Returns `true` if `$value` matches this matcher's criteria.

@param mixed $value The value to check.

@return bool True if the value matches.
345178
public function matches($value): bool
    {
        if (!interface_exists($this->type) && !class_exists($this->type)) {
            throw new UndefinedTypeException($this->type);
        }

        return $value instanceof $this->type;
    }
558123
public function checkValue(&$value)
    {
        if (parent::checkValue($value) === true) {
            if (!preg_match('/^(?:from|to|(?:\d{1,2}|100)%)$/D', $value)) {
                $this->setIsValid(false);
                $this->addValidationError("Invalid value '$value' for the keyframe selector.");

                return false;
            }
            return true;
        }

        return false;
    }
312228
public function containsValue($value): bool {
        $node = $this->getHead();
        while ($node !== null) {
            if (Comparator::equals($node->getValue(), $value)) {
                return true;
            }
            $node = $node->getNext();
        }
        return false;
    }
629668
public function isCompatible($value) {
		// If null, we are compatible
		if ($value === null) {
			return true;
		}
		
		// If the value passed is an array
		if (is_array($value)) {
			// Let's check if this type is an array.
			if (!$this->isArray()) {
				return false;
			}
			if (!$this->isAssociativeArray()) {
				// Let's check if the array passed in parameter has string values as keys.
				foreach ($value as $key=>$val) {
					if (is_string($key)) {
						return false;
					}
				}
			}
			// Now, let's test each subkey for compatibility
			foreach ($value as $key=>$val) {
				if (!$this->subType->isCompatible($val)) {
					return false;
				}
			}
			return true;
		} elseif ($value instanceof MoufInstanceDescriptor) {
			// Let's check if the instance descriptor is compatible with our type.
			if ($this->isPrimitiveType()) {
				return false;
			}
			if ($this->type == "array") {
				return false;
			}
			$classDescriptor = $value->getClassDescriptor();
			if (ltrim($this->type,'\\') == ltrim($classDescriptor->getName(), '\\')) {
				return true;
			}
			//$type = new MoufReflectionClass($this->getType());
			$result =  $classDescriptor->isSubclassOf($this->getType());
			return $result;
		} else {
			// The value is a primitive type.
			if ($this->isPrimitiveType()) {
				return true;
			} else {
				return false;
			}
		}
	}
1177050
public static function match($value, $comparable)
    {
        if (is_array($comparable) || is_array($value) || is_object($comparable) || is_object($value)) {
            return false;
        }
        
        $comparable = trim($comparable);

        if (preg_match("/^$comparable$/", $value)) {
            return true;
        }

        return false;
    }
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);
    }
744665
public static function equalTo($value): Matcher
    {
        $container = self::$globals::$container;

        return $container->matcherFactory->equalTo($value, false);
    }
349051
final public function equals($value)
    {
        if ($value instanceof Enum) {
            return $this->value == $value->getValue();
        }
        return $this->value == $value;
    }
1265245
public function acceptsValue($value): bool {
		switch ($this->operator) {
			case CriteriaComparator::OPERATOR_NOT_IN:
				if ($value === null) return true;
				return !$this->in($value);
			case CriteriaComparator::OPERATOR_IN:
				if ($value === null) return false;
				return !$this->in($value);
				
			case CriteriaComparator::OPERATOR_CONTAINS_NOT:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if ($this->in($relationEntry)) return false;
				}
				
				return true;
			case CriteriaComparator::OPERATOR_CONTAINS:
				ArgUtils::assertTrue(is_array($value));
				
				foreach ($value as $relationEntry) {
					if (!$this->in($relationEntry)) return false;
				}
				
				return true;
		}
	}
253849
private function check($value) {

		if(true === is_string($value)) {
			return false !== filter_var(trim($value), \FILTER_VALIDATE_EMAIL);
		}

		return false;
	}
44616
private function check($value) {

		if(true === is_string($value)) {
			return false === in_array(preg_match('/^(((?=.*(::))(?!.*\3.+\3))\3?|([\dA-F]{1,4}(\3|:\b|$)|\2))(?4){5}((?4){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z/i', $value), [false, 0]);
		}

		return false;
	}
126896
public function isValid($value)
    {
        $this->setValue($value);

        $pattern = '/^[a-z0-9_\-]*[a-z0-9]$/i';

        $this->pageNameOk = true;

        if (!preg_match($pattern, $value)) {
            $this->error(self::PAGE_NAME);
            $this->pageNameOk = false;
        }

        return $this->pageNameOk;
    }
87985
public function isAssignableFromValue($value)
    {
        if (!is_object($value))
            return false;

        if (get_class($value) === $this->getName())
            return true;

        return is_subclass_of($value, $this->className);
    }
851213
public function isValid($value)
    {
        $result = preg_match('/(.+)/i', $value);
        if (!$result) {
            $this->addMessage('notEmpty');
        }
        return (boolean) $result;
    }
106763
public function match($value)
    {
        $match = array();
        $clean = $this->validate($this->clean($value));

        if (!preg_match($this->expression, $clean, $match)) {
            return false;
        }

        $params = array_slice($match, 1);

        for ($i = count($this->captureKeys) - 1; $i >= 0; $i--) {
            if (!isset($params[$i])) {
                continue;
            }

            $key                = $this->captureKeys[$i];
            $this->params[$key] = $params[$i];

            unset($params[$i]);
        }

        $this->params = array_merge($this->params, $params);

        ksort($this->params, SORT_STRING);

        if (!$this->matchFilters($this->params)) {
            return false;
        }

        return $this->params;
    }
855753
public function match($type, $value = null)
    {
        if ($this->type === $type || (is_array($type) && in_array($this->type, $type))) {
            if (null === $value || $this->value == $value || (is_array($value) && in_array($this->value, $value))) {
                return true;
            }
        }
        return false;
    }
1299612
public function validate(string $value)
    {
        if (!$value || $this->value === $value) {
            return;
        }

        $this->error['match'] = [$this->value];
    }