@param array $eventData

@return string
517372
private function captureReceiveMessageText(array $eventData)
    {
        $type = strtolower(@$eventData['message']['type']);

        switch ($type) {
            case Constants::REVEIVE_TYPE_MESSAGE_TEXT:
                return @$eventData['message']['text'];

            default:
                throw new \RuntimeException("Unknown message type `$type`.");
        }
    }
803506
public static function srv(array $rdata): string
    {
        return pack('nnn', (int) $rdata['priority'], (int) $rdata['weight'], (int) $rdata['port']).
            Encoder::encodeDomainName($rdata['target']);
    }
460319
private function formatTreeData(array $treeData)
    {
        return array_map(function($data){

            $formated = [
                'label'    => $data['data'],
                'type'     => $data['type'],
                'uri'      => $data['attributes']['data-uri'],
                'classUri' => $data['attributes']['data-classUri'],
                'signature' => $data['attributes']['data-signature'],
                'state'    => isset($data['state']) ? $data['state'] : false,
                'count'    => isset($data['count']) ? $data['count'] : 0
            ];
            if(isset($data['children'])){
                $formated['children'] = $this->formatTreeData($data['children']);
            }
            return $formated;
        }, $treeData);
    }
806073
public function formatTemplateData($viewData = [])
    {
        $log = '';
        reset($viewData);
        foreach ($viewData as $viewName => $viewDataObject) {
            // show debbuging information
            $log .= "TemplateData[$viewName] : <br />\n";
            $log .= print_r($viewDataObject, 1);
        }

        return $log;
    }
729332
public static function soa(array $rdata): string
    {
        return
            Encoder::encodeDomainName($rdata['mname']).
            Encoder::encodeDomainName($rdata['rname']).
            pack(
                'NNNNN',
                $rdata['serial'],
                $rdata['refresh'],
                $rdata['retry'],
                $rdata['expire'],
                $rdata['minimum']
            );
    }
291628
public function dispatchEvent($eventData)
    {
        $event = $this->eventPrefix.'.'.$eventData['event'];
        unset($eventData['event']);

        $eventData[RecordHandler::COL_PLUGIN] = $this;
        $this->dispatcher->dispatch($event, [$eventData]);
    }
587228
public function saveEvent($eventData)
    {
        $serializedEvent = $this->jsonSerializer->serialize($eventData);
        $insertData = ['event_id' => md5($serializedEvent . time()), 'data' => $serializedEvent];
        $this->getConnection()->insertOnDuplicate($this->getMainTable(), $insertData, ['data']);
    }
1369087
public function display_custom_fields_data(array $fieldsdata) : string {
        global $PAGE;
        $output = $PAGE->get_renderer('core_customfield');
        $content = '';
        foreach ($fieldsdata as $data) {
            $fd = new field_data($data);
            $content .= $output->render($fd);
        }

        return $content;
    }
220548
private function getEventMessage(Event $event)
    {
        return json_encode([
            'title' => $event->getTitle(),
            'text' => $event->getText(),
            'timestamp' => $event->getTimeStamp(),
            'host' => $event->getHost(),
            'type' => $event->getType()
        ]);
    }
480591
protected function getCreationEvent($formData)
    {
        $brandCreateEvent = new BrandCreateEvent();

        $brandCreateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setVisible($formData['visible'])
        ;

        return $brandCreateEvent;
    }
660129
public function encode(array $data): string
    {
        $document = new \DOMDocument('1.0', 'UTF-8');
        $document->formatOutput = $this->prettyPrint;

        $listNode = $this->createMetadataNode($document, $data['_type'] ?? null);

        unset($data['_type']);

        $document->appendChild($listNode);

        $this->dataToNodes($document, $listNode, $data);

        return trim($document->saveXML($document, LIBXML_NOEMPTYTAG));
    }
1182905
private static function readUnicodeStringShort($subData)
    {
        $value = '';

        // offset: 0: size: 1; length of the string (character count)
        $characterCount = ord($subData[0]);

        $string = self::readUnicodeString(substr($subData, 1), $characterCount);

        // add 1 for the string length
        $string['size'] += 1;

        return $string;
    }
276922
private function getValidationMessages(array $validationData)
    {
        $messages = array();
        $messagesData = $validationData['messages'];
        foreach ($messagesData as $messageData) {
            $message = new W3CMarkupValidatorMessage($messageData);
            $messages[] = $message;
        }

        return $messages;
    }
1310274
public function createEvent(array $data)
    {
        $json = json_encode($data);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
831115
protected function getUpdateEvent($formData)
    {
        $event = new IndexEngineIndexEvent();

        $event->setId($formData["id"]);
        $event->setVisible($formData["visible"]);
        $event->setCode($formData["code"]);
        $event->setTitle($formData["title"]);
        $event->setType($formData["type"]);
        $event->setEntity($formData["entity"]);
        $event->setSerializedColumns($formData["serialized_columns"]);
        $event->setSerializedCondition($formData["serialized_condition"]);
        $event->setIndexEngineDriverConfigurationId($formData["index_engine_driver_configuration_id"]);

        return $event;
    }
987894
public function create(array $searchData): string
    {
        $searchData = Validator::validateData($this->table, $searchData, $this->user);

        // pre-save search
        return $this->preSave($searchData);
    }
385732
protected function getUpdateEvent($formData)
    {
        // Build the product attributes array
        $productAttributes = [];

        foreach ($formData['product_attributes'] as $productId => $attributeAvIdList) {
            if (! empty($attributeAvIdList)) {
                $productAttributes[$productId] = explode(',', $attributeAvIdList);
            }
        }

        $saleUpdateEvent = new SaleUpdateEvent($formData['id']);

        $saleUpdateEvent
            ->setStartDate($formData['start_date'])
            ->setEndDate($formData['end_date'])
            ->setActive($formData['active'])
            ->setDisplayInitialPrice($formData['display_initial_price'])
            ->setPriceOffsetType($formData['price_offset_type'])
            ->setPriceOffsets($formData['price_offset'])
            ->setProducts($formData['products'])
            ->setProductAttributes($productAttributes)
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setSaleLabel($formData['label'])
            ->setChapo($formData['chapo'])
            ->setDescription($formData['description'])
            ->setPostscriptum($formData['postscriptum'])
        ;

        return $saleUpdateEvent;
    }