@param ValueInterface $value

@return boolean
966200
public function refersTo(ValueInterface $value)
    {
        if ($this->innerValue() === $value) {
            return true;
        }
        if (
            $this->innerValue() instanceof self &&
            $this->innerValue()->innerValue() === $value
        ) {
            return true;
        }

        return false;
    }
576289
protected function isValid(&$value): ConstraintInterface
    {
        if ($this->constraintsSet instanceof ConstraintsSetInterface) {
            $this->constraintsSet->isValid($value);
        }

        return $this;
    }
948226
public function sameValueAs(ValueObjectInterface $real)
    {
        if (false === Util::classEquals($this, $real)) {
            return false;
        }

        return $this->toNative() === $real->toNative();
    }
66257
public function hasValue($value)
    {
        $index = array_search($value, $this->values);

        if ($index === false) {
            return false;
        }

        return true;
    }
288669
public function filter($value)
    {
        /** @var InputFilterInterface $filter */
        foreach ($this->filters as $filter) {
            if (true === is_array($value)) {
                $values = array();
                foreach ($value as $child) {
                    if (null !== $filtered = $filter->filter($child)) {
                        $values[] = $filtered;
                    }
                }
                $value = $values;
            } else {
                $value = $filter->filter($value);
            }
        }

        return $value;
    }
663060
protected static function coerceValue(TypeInterface $type, $value)
    {
        if ($type instanceof NonNullModifier) {
            // Note: we're not checking that the result of coerceValue is non-null.
            // We only call this function after calling isValidValue.
            return self::coerceValue($type->getWrappedType(), $value);
        }

        if (!isset($value)) {
            return NULL;
        }

        if ($type instanceof ListModifier) {
            $itemType = $type->getWrappedType();
            if (is_array($value)) {
                return array_map(function ($item) use ($itemType) {
                    return Values::coerceValue($itemType, $item);
                }, $value);
            } else {
                return [self::coerceValue($itemType, $value)];
            }
        }

        if ($type instanceof InputObjectType) {
            $fields = $type->getFields();
            $object = [];
            foreach ($fields as $fieldName => $field) {
                $fieldValue = self::coerceValue($field->getType(), $value[$fieldName]);
                $object[$fieldName] = $fieldValue === NULL ? $field->getDefaultValue() : $fieldValue;
            }

            return $object;
        }

        if ($type instanceof ScalarType || $type instanceof EnumType) {
            $coerced = $type->coerce($value);
            if (NULL !== $coerced) {
                return $coerced;
            }
        }

        return NULL;
    }
78701
protected function resolveAtoms(
        PointerInterface $pointer,
        array &$atoms,
        ValueInterface $value
    ) {
        $atom = array_shift($atoms);

        if ($value instanceof ObjectValue) {
            $value = $this->resolveObject($pointer, $atom, $value);
        } elseif ($value instanceof ArrayValue) {
            $value = $this->resolveArray($pointer, $atom, $value);
        } else {
            return null;
        }

        if (null === $value) {
            return null;
        }

        if (count($atoms) > 0) {
            return $this->resolveAtoms($pointer, $atoms, $value);
        }

        return $value;
    }
802000
public function sameValueAs(ValueObjectInterface $collection)
    {
        if (false === Util::classEquals($this, $collection) || false === $this->count()->sameValueAs($collection->count())) {
            return false;
        }

        $arrayCollection = $collection->toArray();

        foreach ($this->items as $index => $item) {
            if (!isset($arrayCollection[$index]) || false === $item->sameValueAs($arrayCollection[$index])) {
                return false;
            }
        }

        return true;
    }
216533
public function setValue($value)
    {
        if ($value instanceof DateInterval) {
            $value = Utils::now()->add($value);
        }

        if ($value instanceof DateTimeInterface) {
            $value = $value->getTimestamp();
        }

        return parent::setValue($value);
    }
1288955
public function isEAVFilter(FilterInterface $filter): bool
    {
        try {
            $this->getEAVAttributes($filter);

            return true;
        } catch (MissingAttributeException $e) {
            return false;
        }
    }
1140085
public function isValid($value)
    {
        if (!$value instanceof ApplicationInterface) {
            $this->error('NO_APPLICATION');

            return false;
        }

        $error = false;

        if ('' == $value->getContact()->getEmail()) {
            $error = true;
            $this->error('NO_EMAIL');
        }

        if (!$value->getAttributes()->getAcceptedPrivacyPolicy()) {
            $error = true;
            $this->error('NO_ACCEPT_PP');
        }

        return !$error;
    }
779857
public function sameValueAs(ValueObjectInterface $country)
    {
        if (false === Util::classEquals($this, $country)) {
            return false;
        }

        return $this->getCode()->sameValueAs($country->getCode());
    }
1035978
public function with($value): ValidableInterface
    {
        parent::with($value);
        
        if (false === ($value instanceof EntityInterface)) {
            throw new ValidatorException(sprintf('Validator accept only (%s) objects', EntityInterface::class));
        }
        
        return $this;
    }
249818
public function sameValueAs(ValueObjectInterface $enum)
    {
        if (false === Util::classEquals($this, $enum)) {
            return false;
        }

        return $this->toNative() === $enum->toNative();
    }
603317
public function sameValueAs(ValueObjectInterface $uuid)
    {
        if (false === Util::classEquals($this, $uuid)) {
            return false;
        }

        return $this->toNative() === $uuid->toNative();
    }
1045243
public function sameValueAs(ValueObjectInterface $integer)
    {
        if (false === Util::classEquals($this, $integer)) {
            return false;
        }

        return $this->toNative() === $integer->toNative();
    }
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");
        }
    }