Retrieve all messages and flushes them all

@return array
772684
public function get()
    {
        self::$messages = $this->getSessionDriver()->get('_messages_', []);
        $messages = self::$messages;
        $this->flush();
        return $messages;
    }
1325386
public function recordedMessages()
    {
        $allRecordedMessages = [];

        foreach ($this->messageRecorders as $messageRecorder) {
            $allRecordedMessages = array_merge($allRecordedMessages, $messageRecorder->recordedMessages());
        }

        return $allRecordedMessages;
    }
771009
public function getMessages()
    {
        $message = [];
        foreach ($this->errorList as $item) {
            $message[] = $item->getMessage();
        }

        return $message;
    }
719604
private function processAllMessages()
    { 
        $processed = [];

        $receivers = $this->receivers();

        $messages = $this->manager->getMessages();
        
        foreach ($receivers as $receiver)
        {   
            foreach ($messages as $index => $message)
            {                
                $this->composition($receiver, $message);

                $id = $this->sendMessage($receiver, $message);

                $copy = new stdClass();
                $copy->id = $id;
                $copy->type = $message->type;
                $copy->sender = $this->account['number'];
                $copy->nickname = $this->account['nickname'];
                $copy->to = implode(', ', (array) $receiver);

                $copy->message = $message;

                if(isset($message->file) && !$message->hash)
                {
                    $copy->message->hash = $messages[$index]->hash = base64_encode(hash_file("sha256", $message->file, true));
                }

                foreach ($this->manager->getInjectedVars() as $key => $value)
                {
                    $copy->$key = $value;
                }

                $processed[] = $copy;
            }
        }

        $this->broadcast = false;

        $this->manager->clear();

        return $processed;
    }
291835
public function getMessages($clear = false)
    {
        if ($clear) {
            return $this->session->getFlashBag()->takeAll();
        }

        return $this->session->getFlashBag()->all();
    }
730509
public function getMessages($clear = false) {
        $messages = $this->getData('messages');
        if ( ! is_array($messages)) {
            $messages = array();
        }
        return $messages;
    }
79974
public function getMessages()
    {
        $this->getBotId();

        $messageContent = $this->getMessageContent($this->event->get('id'));

        $message = new IncomingMessage($messageContent->text, $messageContent->roomId, $messageContent->personId, $messageContent);

        if ($this->getBotId() === $messageContent->personId) {
            $message->setIsFromBot(true);
        }

        return [$message];
    }
793675
public function getMessages()
    {
        $message = new IncomingMessage(File::PATTERN, $this->event->get('from')['id'], $this->event->get('conversation')['id'],
            $this->payload);
        $message->setFiles($this->getAttachmentUrls());

        return [$message];
    }
196309
public function reset()
    {
        $this->messages = [];

        foreach (self::$when as $when) {
            $this->messages[$when] = [];
        }

        return $this;
    }
385905
public function flushMessage(){
        if( session_id() ){
            foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
                if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
                    $markup = sprintf('<div class="%s"><p>%s</p></div>', $class_name, implode('<br />', $_SESSION[$key]));
                    if( is_admin() ){
                        echo $markup;
                    }else{
                        /**
                         * Post redirect get message's filter
                         *
                         * @param string $markup html string
                         * @param array $messages Messages' array
                         * @param string $class_name updated or error.
                         * @return string
                         */
                        echo apply_filters('wpametu_prg_message_class', $markup, $_SESSION[$key], $class_name);
                    }
                    // Make session empty.
                    $_SESSION[$key] = [];
                }
            }
        }
    }
714018
public function flush()
    {
        if (null === $this->routesFactory) {
            $routes = new RouteCollection();
        } else {
            $routes = $this->routesFactory;
        }

        return $this->doFlush('', $routes);
    }
583038
public function clearMessages()
    {
        if (isset($this->storage[$this->storageKey])) {
            $this->storage[$this->storageKey] = [];
        }

        $this->fromPrevious = [];
        $this->forNow = [];
    }
389740
public function flush()
    {
        $bulkRequest = array_filter($this->currentBulkRequest);
        if (count($bulkRequest) === 0) {
            return;
        }

        $content = '';
        foreach ($bulkRequest as $bulkRequestTuple) {
            $tupleAsJson = '';
            foreach ($bulkRequestTuple as $bulkRequestItem) {
                $itemAsJson = json_encode($bulkRequestItem);
                if ($itemAsJson === false) {
                    $this->errorHandlingService->log(
                        new MalformedBulkRequestError('Indexing Error: Bulk request item could not be encoded as JSON - ' . json_last_error_msg(), $bulkRequestItem)
                    );
                    continue 2;
                }
                $tupleAsJson .= $itemAsJson . chr(10);
            }
            $content .= $tupleAsJson;
        }

        if ($content !== '') {
            $response = $this->requestDriver->bulk($this->getIndex(), $content);
            foreach ($response as $responseLine) {
                if (isset($response['errors']) && $response['errors'] !== false) {
                    $this->errorHandlingService->log(
                        new BulkIndexingError($this->currentBulkRequest, $responseLine)
                    );
                }
            }
        }

        $this->currentBulkRequest = [];
    }
205813
public static function getMessages(): array
    {
        $messages = Session::get(self::FLASH_KEY, []);
        Session::forget(self::FLASH_KEY);

        return $messages;
    }
35906
protected function getMessages() {
        if (!$this->_messages) {
            $this->_messages = new MessageList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_messages;
    }
18560
public function getMessages()
    {
        $messages = parent::getMessages();

        $options = $this->getOptions();
        foreach ($options as $option) {
            $widget = $this->getEntryWidget($option->value);
            $messages = array_merge($messages, $widget->getMessages());
        }

        return $messages;
    }
792188
public function flushAll()
    {
        foreach ($this->drivers as $driver) {
            $driver->flushAll();
        }

        $this->registry = [];
        $this->save();

        return $this;
    }