It can be useful to clear the queued messages:
public function clearMessages() : void {
if (isset($this->storage[$this->storageKey])) {
$this->storage[$this->storageKey] = [];
}
}
public function clearMessage(string $key) : void {
if (isset($this->storage[$this->storageKey][$key])) {
unset($this->storage[$this->storageKey][$key]);
}
}
It can be useful to clear the queued messages: