public function flush($severity = null)
    {
        if ($severity === null) {
            $this->messages = [];
        } else {
            foreach ($this->messages as $index => $message) {
                if ($message->getSeverity() === $severity) {
                    unset($this->messages[$index]);
                }
            }
        }
    }
public function flush($severity = null)
    {
        if ($severity === null) {
            $this->messages = [];
        } else {
            foreach ($this->messages as $index => $message) {
                if ($message->getSeverity() === $severity) {
                    unset($this->messages[$index]);
                }
            }
        }
    }
public function flush ( $ severity = null ) { if ( $ severity === null ) { $ this -> messages = [ ] ; } else { foreach ( $ this -> messages as $ index => $ message ) { if ( $ message -> getSeverity ( ) === $ severity ) { unset ( $ this -> messages [ $ index ] ) ; } } } }
Remove messages from this container.

@param string $severity severity of messages (from Message::SEVERITY_* constants) to remove.
@return void
@Flow\Session(autoStart=true)
@api
Remove messages from this container .