public function get(string $type): array
    {
        if (isset($this->messages[$type])) {
            $messages = $this->messages[$type];

            // Clear messages
            $this->clear($type);

            return $messages;
        } else {
            return [];
        }
    }
public function get(string $type): array
    {
        if (isset($this->messages[$type])) {
            $messages = $this->messages[$type];

            // Clear messages
            $this->clear($type);

            return $messages;
        } else {
            return [];
        }
    }
public function get ( string $ type ) : array { if ( isset ( $ this -> messages [ $ type ] ) ) { $ messages = $ this -> messages [ $ type ] ; // Clear messages $ this -> clear ( $ type ) ; return $ messages ; } else { return [ ] ; } }
Get all messages for given type and clear flash bag of them.

@param string $type Type of message

@return string[] List of messages
Get all messages for given type and clear flash bag of them .