@param ModifierInterface $value

@throws InvalidArgumentException

@return bool
777093
public function add($value)
    {
        if (! $value instanceof ModifierInterface) {
            throw new InvalidArgumentException(sprintf(
                '"%s" does not implement "%s"!',
                (is_object($value)) ? get_class($value) : $value,
                ModifierInterface::class
            ));
        }

        return parent::add($value);
    }
1362174
public function checkValue(&$value)
    {
        if (is_string($value)) {
            $value = Placeholder::replaceStringsAndComments($value);
            $value = Placeholder::removeCommentPlaceholders($value, true);
            $value = Placeholder::replaceStringPlaceholders($value, true);
            $value = trim($value);

            if ($value !== '') {
                return true;
            } else {
                $this->setIsValid(false);
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($value). "' for argument 'value' given."
            );
        }
    }
545263
static function ByValue($value)
    {
        $calledClass = get_called_class();
        $allowed = self::AllowedClassValues($calledClass);
        if (!in_array($value, $allowed, true))
            throw new \InvalidArgumentException('Value ' . $value . ' not allowed for enum ' . $calledClass);
        
        return new $calledClass($value);
    }
1161639
public function append($value)
    {
        if (!$value instanceof Argument) {
            throw new \InvalidArgumentException(sprintf('Controller arguments must be valid %s objects.', Argument::class), 1187953786);
        }
        $this->offsetSet(null, $value);
    }
840338
public function isContextMatching(ContextualValueInterface $value, array $context)
    {
        if (!$value->getContext()) {
            return true;
        }
        $value::checkContext($context);
        foreach ($this->getContextMask() as $key) {
            $contextKey = array_key_exists($key, $context) ? $context[$key] : null;
            if ($contextKey !== $value->getContextValue($key)) {
                return false;
            }
        }

        return true;
    }
981916
public function setValue($value, EntityInterface $entity = null)
    {
        $attribute_validator = $this->getAttribute()->getValidator();
        $validation_result = $attribute_validator->validate($value, $entity);

        if ($validation_result->getSeverity() <= IncidentInterface::NOTICE) {
            $previous_native_value = $this->toNative();
            $this->value = $validation_result->getSanitizedValue();

            if (!$this->sameValueAs($previous_native_value)) {
                $value_changed_event = $this->createValueHolderChangedEvent($previous_native_value);
                $this->propagateValueChangedEvent($value_changed_event);
            }

            if ($this->value instanceof CollectionInterface) {
                $this->value->addListener($this);
            }
            if ($this->value instanceof EntityList) {
                $this->value->addEntityChangedListener($this);
            }
        }

        return $validation_result;
    }
316061
public function normalizeValue($value)
	{
		if ($value instanceof AttributeFilter)
		{
			return $value;
		}

		if (is_callable($value))
		{
			return new AttributeFilter($value);
		}

		throw new InvalidArgumentException('Argument 1 passed to ' . __METHOD__ . ' must be a valid callback or an instance of s9e\\TextFormatter\\Configurator\\Items\\AttributeFilter');
	}
201372
public function getI($value, AbstractModule $mod = null){
	    $this->checkInit();
		return $this->cache->getItem($this->getKeyName($value, $mod));
	}
976111
public function offsetSet($offset, $value) {

		if (is_null($offset)) {
			throw new \InvalidArgumentException('Invalid NULL offset. Only named offsets allowed.');
		}
		$this->values[$offset] = $value;

	}
475540
public function isValid($value, $context = null): bool
    {
        if (!is_array($context)) {
            $this->error(self::INVALID);
            return false;
        }

        if (!in_array($this->getCommentType(), $this->validCommentTypes)) {
            $this->error(self::INVALID_COMMENT_TYPE);
            return false;
        }

        $this->setValue($value);

        $akismet = new AkismetService($this->getApiKey(), $this->getBlog());

        if (!$akismet->verifyKey($this->getApiKey())) {
            throw new Exception\InvalidArgumentException('Invalid API key for Akismet');
        }

        $data = [
            'comment_type'          => $this->getCommentType(),
            'comment_author'        => $context[$this->getCommentAuthor()],
            'comment_author_email'  => $context[$this->getCommentAuthorEmail()],
            'comment_author_url'    => $context[$this->getCommentAuthorUrl()] ?? '',
            'comment_content'       => $value,
            'user_agent'            => $this->getUserAgent(),
            'user_ip'               => $this->getUserIp(),
        ];

        if ($akismet->isSpam($data)) {
            $this->error(self::SPAM);
            return false;
        }

        return true;
    }
1061981
public static function validateType($value)
    {
        if (get_called_class() === $value) {
            return true;
        }
        if (array_key_exists($value, class_implements(get_called_class()))) {
            return true;
        }
        if (array_key_exists($value, class_parents(get_called_class()))) {
            return true;
        }
        throw new InvalidDataTypeException(__CLASS__, new static);
    }
914502
protected function execute($value, EntityInterface $entity = null)
    {
        $success = true;
        $collection = null;

        if ($value instanceof EntityList) {
            $collection = $value;
        } elseif (null === $value) {
            $collection = new EntityList();
        } elseif (is_array($value)) {
            $collection = $this->createEntityList($value);
        } else {
            $this->throwError('invalid_type');
            $success = false;
        }

        if ($success) {
            $this->setSanitizedValue($collection);
        }

        return $success;
    }
524104
public function offsetSet( $offset, $value )
	{
		if( $this instanceof TypeOfInterface && ! $this->typeOf($value, $offset) )
		{
			throw new \InvalidArgumentException("Invalid data type for offset item");
		}

		if (is_null($offset))
		{
			$this->items[] = $value;
		}
		else
		{
			$this->items[$offset] = $value;
		}
	}
998494
protected function checkValueStructure(BaseValue $value)
    {
        if (!is_array($value->tags)) {
            throw new InvalidArgumentType(
                '$value->tags',
                'array',
                $value->tags
            );
        }

        foreach ($value->tags as $tag) {
            if (!$tag instanceof Tag) {
                throw new InvalidArgumentType(
                    "${tag}",
                    Value::class,
                    $tag
                );
            }
        }
    }
1015067
public function add($value)
    {
        if (!$value instanceof Contact) {
            throw new InvalidArgumentException(
                sprintf(
                    '%s only accepts instances of %s.',
                    __FUNCTION__, Contact::class
                )
            );
        }

        return parent::add($value);
    }
495896
public function offsetSet($offset, $value)
    {
        $this->checkType($value);
        if ($offset != $value->name()) {
            throw new InvalidArgumentException("The offset has to be the name of the constraint");
        }
        $this->constraints[$value->name()] = $value;
    }
624190
public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            throw new InvalidArrayAssignment();
        } else {
            $this->set($offset, $value);
        }
    }