Add violation
@param string $key
@param array|string $message
978163
public function add($key, $message)
    {
        if (empty($this->violations[$key])) {
            $this->violations[$key] = [];
        }

        $this->violations[$key] = array_merge(
            $this->violations[$key],
            (array) $message
        );

        return $this;
    }
121874
protected function addError($attribute, $message)
    {
        if (!isset($this->errors[$attribute])) {
            $this->errors[$attribute] = array();
        }
        $this->errors[$attribute][] = $message;
    }
866081
public function withDetail($key, $message)
    {
        assert(!is_null($key), 'Key must not be null');
        assert(!is_null($message), 'Message must not be null');
        $this->details[strval($key)] = $message;

        return $this;
    }
1334539
private static function addError($message): void
    {
        if (self::$result === false) {
            self::$result = array();
        }
        self::$result[] = $message;
    }
35977
protected void addViolation(MethodCallExpression node, String message) {
        if (node.getLineNumber() >= 0) {
            int lineNumber = AstUtil.findFirstNonAnnotationLine(node, sourceCode);
            String sourceLine = sourceCode.line(AstUtil.findFirstNonAnnotationLine(node, sourceCode) - 1);
            Violation violation = new Violation();
            violation.setRule(rule);
            violation.setLineNumber(lineNumber);
            violation.setSourceLine(sourceLine);
            if (currentClassNode != null) {
                violation.setMessage(String.format(
                        "Violation in class %s. %s", currentClassNode.getName(), message
                ));
            } else {
                violation.setMessage(message);
            }
            violations.add(violation);
        }
    }
258580
public function addMessage($key, array $args = array())
    {
        // We will only display these messages once.
        if (isset($this->keys[$key]) === false) {
            // Add it to the keys, so the CMS can display it.
            $this->keys[$key] = array('key' => $key, 'params' => $args);
            $this->messages[] = $this->getHelp($key, $args);
        }
    }
12494
public function addError($message, ...$text): void
    {
        $this->add(self::TYPE_ERROR, $message, ...$text);
    }
405084
public function minLength($key, $minLength, $message = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => $name) {
                $this->minLength($name, is_array($minLength) ? $minLength[$k] : $minLength, $message);
            }
        } else {
            if (isset($this->scope[$key]) && mb_strlen($this->scope[$key]) < $minLength) {
                $this->errors[$key] = sprintf($message !== null ? $message : self::$minLengthMessage, $key, $minLength);
            }
        }

        return $this;
    }
199201
protected void addMessage(String message)
    {
        messages.add(message);
        messageCount++;
        if (messageCount > messagesQueueMax)
        {
            messages.remove();
            messageCount--;
        }
    }
647026
public function addViolation($message, array $parameters = [], $property = null)
    {
        if ($property) {
            $path = '' !== $this->getCurrentPath() ? $this->getCurrentPath().'/'.$property : '/'.$property;
        } else {
            $path = $this->getCurrentPath();
        }

        $this->violations[] = [
            'path' => $path,
            'message' => vsprintf($message, $parameters),
        ];
    }
122338
public function buildViolation($message, array $parameters = []): ConstraintViolationBuilderInterface
    {
        return new ConstraintViolationBuilder($this->violations, $message, $parameters, $this->path);
    }
1251541
public function push(string $errorMessage, ?string $key = null): self
    {
        if ($key === null) {
            $this->errors[] = $errorMessage;
        } else {
            $this->errors[$key][] = $errorMessage;
        }

        return $this;
    }
775363
public function setActionError($key, $message) {
        if (!isset($message)) {
            unset($this->attributes[ACTION_ERRORS_KEY][$key]);
        }
        elseif (is_string($message)) {
            $this->attributes[ACTION_ERRORS_KEY][$key] = $message;
        }
        else throw new IllegalTypeException('Illegal type of parameter $message: '.gettype($message));
    }
453942
public function addMessage($message)
    {
        collect((array) $message)->each(function ($item) {
            collect($item)->flatten()->each(function ($flattened) {
                $this->messageList->push($flattened);
            });
        });
    }
828148
public function add($key, $message)
    {
        if ($this->isUnique($key, $message)) {
            $this->messages[$key][] = $message;
        }

        return $this;
    }
999576
protected function _error($messageKey, $value = null)
    {
        if ($messageKey === null) {
            $keys       = array_keys($this->_messageTemplates);
            $messageKey = current($keys);
        }
        if ($value === null) {
            $value = $this->_value;
        }
        $this->_messages[$messageKey] = $this->_createMessage($messageKey, $value);
    }
834838
public function addError($message, ...$args)
    {
        $message = $this->translate($message);
        if (!empty($args)) $message = vsprintf($message, $args);
        
        $this->errors[] = $message;
    }