Add a message to the collector.

<code>
// Add a message for the e-mail attribute
$messages->add('email', 'The e-mail address is invalid.');
</code>

@param  string  $key
@param  string  $message
@return void
187493
public function add($key, $message)
	{
		if ($this->unique($key, $message)) $this->messages[$key][] = $message;
	}
680277
protected function add($type, $message, ...$text): void
    {
        $this->getMessagesStore()[$type][] = Translator::translate($message, ...$text);
    }
222972
protected function appendMessage(string $message): void
    {
        $this->messages[] = $message;

        if (sizeof($this->messages) > $this->config['max_messages']) {
            array_shift($this->messages);
        }
    }
1278533
public function addMessage($message, $type)
    {
        if (!is_string($message)) {
            throw new \InvalidArgumentException('Message must be a string');
        }
        if (!$message) {
            throw new \InvalidArgumentException('Message can\'t be empty');
        }
        if (!is_string($type)) {
            throw new \InvalidArgumentException('Type must be a string');
        }
        if (!$type) {
            throw new \InvalidArgumentException('Type can\'t be empty');
        }
        $this->messages[$type][] = $message;

        return $this;
    }
761400
public function addMessage($message) {
        $migrationName = get_class($this);
        $this->messages[] = sprintf("%s:  %s\n", $migrationName, $message);
    }
862267
function addMessage($rule, $message, $element = null) {
        $this->messages[$rule . ($element ? '.' . $element : '')] = $message;

        return $this;
    }
341916
public function setAttributeMessage(string $name, string $message)
    {
        $this->messages['custom'][$name] = $message;
        return $this;
    }
700400
public function addMessage($message) {
        if (!is_array(self::$_store->messages)) {
            self::$_store->messages = array();
        }
        $messages = self::$_store->messages;
        // Duplicates are wack
        if (in_array($message, $messages)) {
            return $this;
        }
        $messages[] = $message;
        self::$_store->messages = $messages;
        return $this;
    }
1024413
public function addError($key, $error) {
        if (is_array($key)) {
            $key = implode('_', $key);
        }

        if (array_key_exists($key, $this->errors)) {
            $this->errors[$key][] = $error;
        }
        else {
            $this->errors[$key] = array($error);
        }
    }
991001
public function add(Message $message, $groupName = null) {
		if (!isset($this->messages[$groupName])) {
			$this->messages[$groupName] = array();
		}	
		
		$this->messages[$groupName][] = $message;
	}
159206
private function saveIntoCache($key, MessageInterface $message)
    {
        if ($this->cache) {
            $item = $this->cache->getItem($key);

            $item->set([
                $message->getHeaders(),
                (string) $message->getBody(),
            ]);

            $this->cache->save($item);
        }
    }
461172
public function required($key, $message = null)
    {
        if (is_array($key)) {
            foreach ($key as $name) {
                $this->required($name, $message);
            }
        } else {
            if ( ! (isset($this->scope[$key]) && ! empty($this->scope[$key]))) {
                $this->errors[$key] = sprintf($message !== null ? $message : self::$requiredMessage, $key);
            }
        }

        return $this;
    }
525279
public function add($error, $key = NULL)
    {
        if ($key) {
            $errorContainer = $this->get($key, new static());
            $errorContainer->push($error);
            $this[$key] = $errorContainer;
        } else {
            $this->push($error);
        }
    }
1074148
public function add($key, $data)
    {
        $toInsert = $this->getDocumentData($data);

        $result = $this->collection->insertOne($toInsert);

        $data->_id = $result->getInsertedId();
    }
1284498
protected function addMessage($message) {
		$hash = crc32(json_encode(func_get_args()));
		
		if (isset($this->_messages[$hash])) {
			return;
		}
		
		if (func_num_args() > 1) {
			$this->_messages[$hash] = call_user_func_array('sprintf', func_get_args());
		} else {
			$this->_messages[$hash] = (string) $message;
		}
	}
299131
public function add($key, $message)
    {
        if (! isset($this->errors[$key])) $this->errors[$key] = [];
        $this->errors[$key][] = $message;
    }
828148
public function add($key, $message)
    {
        if ($this->isUnique($key, $message)) {
            $this->messages[$key][] = $message;
        }

        return $this;
    }