@param array $data

@return Messages
977036
public static function fromArray(array $data)
    {
        return new Messages(
            new Message(isset($data['right-message']) ? $data['right-message'] : ''),
            new Message(isset($data['error-message']) ? $data['error-message'] : '')
        );
    }
875388
protected function formatWeappMessage(array $data = [])
    {
        $params = $this->baseFormat($data, $this->weappMessage);

        $params['data'] = $this->formatData($params['data'] ?? []);

        return $params;
    }
94518
protected function message_read($data)
    {
        $cmd = Utility::ParseCommand(ord($data[0]));
        $message_type = $cmd['message_type'];
        $flags = $cmd['flags'];
        Debug::Log(Debug::DEBUG, "message_read(): message_type=" . Message::$name[$message_type] . ", flags={$flags}");
        Debug::Log(Debug::DEBUG, 'message_read(): Dump', $data);
        $pos = 1;
        $remaining_length = Utility::DecodeLength($data, $pos);
        $message_object = $this->getMessageObject($message_type);
        $message_object->decode($data, $remaining_length);
        return $message_object;
    }
32341
public function configure(array $data) 
	{
		$this->checkData($data);
		$body = new MimeMessage();
		$body->addPart($this->getPart($data));
		$this->setBody($body);

		$this->addTo($data['to']);
		//$this->addReplyTo($data['from']);
		$this->setSubject(utf8_decode($this->subject));
		
		return $this;
	}
377103
public function sendSubscription(array $data = [])
    {
        $params = $this->formatMessage($data);

        $this->restoreMessage();

        return $this->httpPostJson('cgi-bin/message/template/subscribe', $params);
    }
129815
public function makeFromArray(array $data): \BearFramework\Emails\Email
    {
        return \BearFramework\Emails\Email::fromArray($data);
    }
766199
private function createDataItems(array $data)
    {
        $items = [];
        foreach ($data as $item) {
            $items[$item['label']] = new UserDataItem(
                $item['label'],
                $item['value'],
                $item['isValid'],
                $item['isOwner']
            );
        }

        return $items;
    }
495472
public function updateTranslation(array $data)
    {
        $translations = $this->translations()->where([
            'record_id'     => $this->id,
            'language_code' => array_get($data, 'language_code'),
        ])->first();

        if (is_null($translations))
            $translations = $this->translations()->create($data);
        else
            $translations->update($data);

        return $translations;
    }
238970
protected function validate(array &$data)
    {
        $messages = [];
        if (!empty($data['errors']) && !empty($data['activity']) && !empty($data['requests'])) {
            array_push($messages, ['warning', trans('It is recommended to periodically clean system logs.')]);
        }
        $data = array_merge($data, ['messages' => $messages]);
        return $data;
    }
403749
protected function parseRelationships(array $data)
    {
        $result = [];
        foreach ($data as $name => $relationshipData) {
            $dataSegment  = $relationshipData !== null ?
                $this->getArrayValue($relationshipData, DocumentInterface::KEYWORD_DATA, null) : null;

            if ($dataSegment === null || (empty($dataSegment) === true && is_array($dataSegment) === true)) {
                $result[$name] = new RelationshipsObject($dataSegment);
                continue;
            }

            if (is_array($dataSegment) === false) {
                $this->errors->addRelationshipError($name, 'Invalid element.');
                continue;
            }

            if ($this->isProbablySingleIdentity($dataSegment) === true) {
                $parsed = $this->parseSingleIdentityInRelationship($name, $dataSegment);
            } else {
                $parsed = $this->parseArrayOfIdentitiesInRelationship($name, $dataSegment);
            }

            if ($parsed !== null) {
                $result[$name] = new RelationshipsObject($parsed);
            }
        }

        return $result;
    }
588413
public static function fromArray($data)
    {
        $email = new SimpleSMS();

        foreach ($data["recipients"] as $recipient) {
            $email->addRecipientByNumber($recipient["number"], $recipient["name"]);
        }

        $email->setText($data["text"]);

        return $email;
    }
298510
public function fromArray(array $data)
    {
        if (!empty($data['id'])) {
            $this->setId($data['id']);
        }

        if (isset($data['recipients'])) {
            $this->setRecipients($data['recipients']);
        }

        if (isset($data['recipient'])) {
            $this->addRecipient($data['recipient']);
        }

        if (isset($data['from'])) {
            $this->setFrom($data['from']);
        }

        if (isset($data['body'])) {
            $this->setBody($data['body']);
        }

        if (isset($data['data'])) {
            $this->setData($data['data']);
        }

        if (isset($data['template_id'])) {
            $this->setTemplateId($data['template_id']);
        }

        if (isset($data['status'])) {
            $this->setStatus($data['status']);
        } else {
            $this->setStatus(MessageStatus::STATUS_QUEUED);
        }

        return $this;
    }
943100
public function update(array $data)
    {
        $messageType = Basecamp::messageTypes($this->bucket->id)
                               ->update($this->id, $data);

        $this->setAttributes($messageType);

        return $messageType;
    }
1036201
private function cleanData(array $data) : array
  {
    foreach($data as $key => $value) {
      $data[$key] = $this->replace($key, $value);
    }

    return $data;
  }
51359
public function xssClean(array $data)
    {
        foreach ($data as $k => $v) {
            $data[$k] = filter_var($v, FILTER_SANITIZE_STRING);
        }

        return $data;
    }
333671
protected static function checkNew(array $data)
    {
        $errors = [];
        if ($missing = array_diff(static::getRequired(), array_keys($data))) {
            $errors[] = 'Missing: ' . implode(', ', $missing);
        }
        foreach ($data as $key => $value) {
            $errors += static::checkProperty($key, $value);
        }
        return $errors;
    }
1040810
public function sendMessage(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_MESSAGE_SEND_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result : $this->dump([self::WECHAT_BASE_URL . self::WECHAT_MESSAGE_SEND_PREFIX, $this->getAccessToken(), $data, $result]);
    }