{@inheritdoc}
@param mixed $value
@throws \ErrorException
509837
public function callPromise(string $name, $value = null)
    {
        $this->wpProvider
            ->applyFilters($name, $value);
    }
687792
public function checkValue(&$value)
    {
        if (parent::checkValue($value) === true) {
            $value = trim($value);
            if (in_array($value,
                [
                    self::SELECTOR_ALL, self::SELECTOR_FIRST, self::SELECTOR_LEFT,
                    self::SELECTOR_RIGHT, self::SELECTOR_BLANK
                ])) {
                return true;
            } else {
                throw new \InvalidArgumentException("Invalid value '" . $value . "' for argument 'value'.");
            }
        }

        return false;
    }
85314
public function validate($value)
    {
        // if value required, then only valueTrue is allowed
        if ($this->required && $value !== $this->valueTrue) {
            throw new ValidationException([$this->name => 'Must be selected']);
        }
    }
1337871
protected function guard($value)
    {
        $localeName = Intl::getLocaleBundle()->getLocaleName($value);

        if (null === $localeName) {
            throw new InvalidLocaleException($value);
        }
    }
996337
private function filter(&$value)
    {
        if (isset($this->patterns[$value])) {
            $value = $this->patterns[$value];
        } else {
            // Test that pattern is a valid REGEXP pattern
            ErrorHandler::start();
            $this->pattern = (string) $value;
            $status        = preg_match($this->pattern, "Test");
            $error         = ErrorHandler::stop();
        
            if (false === $status) {
                throw new Exception\InvalidArgumentException("Internal error parsing the pattern '{$this->value}'", 0, $error);
            }
        }
    }
1316418
public function setDiscriminatorValue(string $value) : void
    {
        if ($this->isFile) {
            throw MappingException::discriminatorNotAllowedForGridFS($this->name);
        }

        $this->discriminatorMap[$value] = $this->name;
        $this->discriminatorValue       = $value;
    }
1166116
public function setValue($value)
    {
        $value = $this->preformatValue($value);
        $manager = $this->getManager();
        $manager->clean();
        foreach ($value as $linkModel) {
            if (
                false === ($linkModel instanceof ModelInterface) &&
                !is_a($linkModel, $this->modelClass)) {
                $linkModel = call_user_func([$this->modelClass, 'objects'])->get(['pk' => $linkModel]);
            }

            if ($linkModel instanceof ModelInterface) {
                $manager->link($linkModel);
            } else {
                throw new Exception('ManyToMany field can set only arrays of Models or existing primary keys');
            }
        }
    }
54903
public function offsetSet($offset, $value)
    {
        if ($offset === null) {
            $this->add($value);
        } else {
            $this->errors[$offset] = $value;
        }
    }
918643
public function setDateVerified( $value )
	{
		if( $value === $this->getDateVerified() ) { return; }

		$this->_checkDateOnlyFormat( $value );

		$this->_values['vdate'] = ( $value ? (string) $value : null );
		$this->setModified();
	}
525158
public function setType($value)
    {
        if (!in_array($value, self::allowedRejectionTypes(), true)) {
            throw new DomainException(self::MSG_UNSUPPORTED_TYPE);
        }

        return $this->setAttribute('type', $value);
    }
1280261
public function setEndHandler($value) {
        if ($value !== null && !is_callable($value)) {
            throw new \Exception('A function is expected, or null.');
        }

        $this->endHandler = $value;
    }
1047729
private function setError($error)
    {
        if (strpos($error, 'ERROR') !== false) {
            if (array_key_exists($error, $this->errors)) {
                throw new Exception($this->errors[$error]);
            } else {
                throw new Exception($error);
            }
        }
    }
617628
protected function validate($value)
    {
        foreach ($this->validators as $validator) {
            if (!$validator->validate($value)) {
                throw new InvalidValueException(
                    "Field {$this->name}, was set with invalid value: " . var_export($value, true)
                );
            }
        }
    }
955949
public function setValue($value)
  {
    if (is_null($value)) {
      $this->value = null;
    } else if (is_bool($value)) {
      $this->value = $value;
    } else if (is_numeric($value)) {
      if ($value == 0) {
        $this->value = false;
      } else{
        $this->value = true;
      }
    } else if ($value == '') {
      $this->value = null;
    } else{
      throw new \Exception(sprintf('Valeur %s non appliquable a un composant de type Boolean', $value));
    }
  }
804250
public function bindValue($value): void
    {
        if ($this->getPDOType($value) === false) {
            throw new \Exception(gettype($value) . " is an invalid type to bind. ");
        }

        $this->bindedValues[] = $value;
    }
1103044
public function set($key, $value)
    {
        $result = $this->allowed($value);
        if ($this->passes($result)) {
            parent::set($key, $this->normalize($value));
        } else {
            throw new \UnexpectedValueException(sprintf(
                'Value of type "%s" forbidden in this instance of %s',
                gettype($value),
                get_class($this)
            ));
        }
    }
170429
protected function setValue($value)
    {
        if (!is_string($value)) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a string", static::prototype());
        }

        if(!mb_check_encoding($value, 'UTF-8')) {
            throw InvalidTypeException::fromMessageAndPrototype("Value must be a UTF-8 encoded", static::prototype());
        }

        $this->value = $value;
    }