@param string $message_xml_file

@return array
967788
public function loadMessageXml(string $message_xml_file): array
    {
        $messageXmlString = \file_get_contents($message_xml_file);
        $messageXml = new \SimpleXMLIterator($messageXmlString);
        unset($messageXmlString);
        $message = [
            "defaults" => $this->readMessageDefaults($messageXml),
            "segments" => $this->readXmlNodes($messageXml),
        ];
        unset($messageXml);

        return $message;
    }
770051
public function listMessages()
    {
        $folder = $this->_path.SEPARATOR.$this->_directory.SEPARATOR."messages";
        $messages = array_slice(scandir($folder), 2);
        foreach ($messages as &$msg) {
            $msg = str_replace('.xml', '', $msg);
        }
        return $messages;
    }
1307107
public function getMessages()
    {
        $messages = parent::getMessages();

        foreach ($this->pages as $page) {
            $messages = array_merge($messages, $page->getMessages());
        }

        return $messages;
    }
262383
protected function loadMappingFile($file)
    {
        $result     = [];
        $xmlElement = simplexml_load_file($file);

        if (isset($xmlElement->entity)) {
            foreach ($xmlElement->entity as $entityElement) {
                $entityName          = (string) $entityElement['name'];
                $result[$entityName] = $entityElement;
            }
        }

        return $result;
    }
329984
protected function getMessages(): array
    {
        $messages = [];

        foreach (array_merge(array_values(app('translation.loader')->namespaces()), [$this->sourcePath]) as $directory) {
            foreach ($this->file->allFiles($directory) as $file) {
                $path = mb_substr($file->getPath(), 0, mb_strrpos($file->getPath(), DIRECTORY_SEPARATOR));
                $namespace = array_search($path, app('translation.loader')->namespaces());

                $pathName = $file->getRelativePathName();
                $extension = $file->getExtension();
                if (! in_array($extension, ['json', 'php'])) {
                    continue;
                }

                if ($this->isMessagesExcluded($pathName)) {
                    continue;
                }

                $key = mb_substr($pathName, 0, -4);
                $key = str_replace('\\', '.', $key);
                $key = str_replace('/', '.', $key);

                if ($namespace) {
                    $key = mb_substr($key, 0, mb_strpos($key, '.') + 1).str_replace('/', '.', $namespace).'::'.mb_substr($key, mb_strpos($key, '.') + 1);
                }

                if (starts_with($key, 'vendor')) {
                    $key = $this->getVendorKey($key);
                }

                if ($extension === 'php') {
                    $messages[$key] = include $file->getRealPath();
                } else {
                    $key = $key.$this->stringsDomain;
                    $fileContent = file_get_contents($file->getRealPath());
                    $messages[$key] = json_decode($fileContent, true);
                }
            }
        }

        $this->sortMessages($messages);

        return $messages;
    }
639001
public static function get(string $messageType): array
    {
        $messages = $_SESSION[self::SESSION_KEY][$messageType] ?? [];

        unset($_SESSION[self::SESSION_KEY][$messageType]);

        return $messages;
    }
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];
    }
434590
public function transform(Template $message)
    {
        return array_merge([
            'template_type' => 'list',
            'top_element_style' => $message->getTopStyle(),
            'elements' => $message->getCollections()->toData(),
        ], $message->getButton() !== null ? ['buttons' => [$message->getButton()->toData()]] : []);
    }
1190408
protected function getBaseXML()
    {
        foreach ($this->requiredFields as $field) {
            $this->validate($field);
        }

        $xml = new \SimpleXMLElement('<SecurePayMessage/>');

        $messageInfo = $xml->addChild('MessageInfo');
        $messageInfo->messageID = $this->getMessageId();
        $messageInfo->addChild('messageTimestamp', $this->generateTimestamp());
        $messageInfo->addChild('timeoutValue', 60);
        $messageInfo->addChild('apiVersion', 'xml-4.2');

        $merchantInfo = $xml->addChild('MerchantInfo');
        $merchantInfo->addChild('merchantID', $this->getMerchantId());
        $merchantInfo->addChild('password', $this->getTransactionPassword());

        $xml->addChild('RequestType', $this->requestType); // Not related to the transaction type

        return $xml;
    }
401068
private function parse($response_xml)
  {
      $xml = simplexml_load_string($response_xml);
      $response = array();

      $response['error_code'] = (string) $xml->ERRORCODE;
      $response['message'] = (string) $xml->ERRORMESSAGE;
      $response['reference'] = (string) $xml->REFERENCE;
      $response['proxypay_ref'] = (string) $xml->PROXYPAYREF;
      $response['sequence'] = (string) $xml->SEQUENCE;

      return $response;
  }
339378
private static function _getXmlFromIpnMessage(Message $ipnMsg)
    {        
        // Try and load the notification data as xml
        $notificationData = $ipnMsg->getMandatoryField("NotificationData");
        
        $dom = new DOMDocument();
        try {
            $dom->loadXML($notificationData);
        } catch (Exception $ex) {
            throw new OffAmazonPaymentsNotifications_InvalidMessageException(
                "Error with ipn message - NotificationData field does not contain xml, " .
                "contents: " . $notificationData
            );
        }
        
        return $dom->documentElement;
    }
1246849
public function getArticles(ArticleListMessage $message): array
    {
        $path = sprintf('sites/%d/articles', $message->getSiteId());

        $response = $this->getClient()->sendRequest(RequestStatus::GET, $path);

        /** @var Article[] $models */
        $models = $this->getModelFactory()->createMany(Article::class, $response);

        return $models;
    }
841203
protected function get_messages()
    {
        $lang_file = __DIR__.DIRECTORY_SEPARATOR.'lang'.DIRECTORY_SEPARATOR.$this->lang.'.php';
        $messages = require $lang_file;

        if ($validation_methods_errors = self::$validation_methods_errors) {
            $messages = array_merge($messages, $validation_methods_errors);
        }
        return $messages;
    }
737860
protected function textMessageToArray()
    {
        $message = [];
        $message['recipient'] = $this->recipient;
        $message['notification_type'] = $this->notificationType;
        $message['message']['text'] = $this->text;

        return $message;
    }
281034
private function getHeaders(PushMessage $message) : array
    {
        return [
            'Authorization' => 'key='.$this->apiKey,
            'Content-Type' => 'application/json',
            'Content-Length' => $message->getContentLength(),
            'Encryption' => 'keyid=p256dh;salt='.$message->getSalt(),
            'Crypto-Key' => 'keyid=p256dh;dh='.$message->getCryptoKey(),
            'Content-Encoding' => 'aesgcm',
            'TTL' => $message->getTTL(),
        ];
    }
1096912
public function getSchemaMessage()
    {
        $message = $this->getMessage();
        if (!$message) {
            return null;
        }
        // Form schema messages treat simple strings as plain text, so nest for html messages
        if ($this->getMessageCast() === ValidationResult::CAST_HTML) {
            $message = ['html' => $message];
        }
        return [
            'value' => $message,
            'type' => $this->getMessageType(),
        ];
    }
237665
function _getMessageFilesArray() {
        $props = array(
            'name' => $this->filename
        );
        
        $file = @\realpath($this->attachment);
        if($file) {
            $props['path'] = $file;
        } elseif(\filter_var($this->attachment, \FILTER_VALIDATE_URL)) {
            $props['path'] = $this->attachment;
        } else {
            $props['data'] = $this->attachment;
        }
        
        if(empty($props['name'])) {
            if(!empty($props['path'])) {
                $props['name'] = \basename($props['path']);
            } else {
                $props['name'] = 'file-'.\bin2hex(\random_bytes(3)).'.jpg';
            }
        }
        
        return $props;
    }