@param CategoryArticleListMessage $message

@return Article[]
197711
public function getCategoryArticles(CategoryArticleListMessage $message): array
    {
        $path = sprintf('sites/%d/categories/%d/articles', $message->getSiteId(), $message->getCategoryId());

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

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

        return $models;
    }
18722
public function transformTextCard(AbstractMessage $message)
    {
        return [
            'msgtype'  => 'textcard',
            'textcard' => [
                'title'       => $message->get('title'),
                'description' => $message->get('description'),
                'url'         => $message->get('url'),
                'btntxt'      => $message->get('btntxt'),
            ],
        ];
    }
466241
public MessageListItem from(final String category) {
		List<String> messages = FluentIterable.from(delegate)
			.filter(byCategory(category))
			.transform(toMessageString())
			.toList();

		return new MessageListItem(messages);
	}
128478
public function publishCategoryArticles(CategoryArticlePublishMessage $message): Category
    {
        $path = sprintf('sites/%d/categories/%d/publish_articles', $message->getSiteId(), $message->getCategoryId());
        $data = ['api_publish_articles' => $message->build()];

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

        /** @var Category $model */
        $model = $this->getModelFactory()->create(Category::class, $response);

        return $model;
    }
1025469
private function tags($message, $data)
    {
        return array_merge(
            array_keys($message->getTo() ?: []),
            array_keys($message->getCc() ?: []),
            array_keys($message->getBcc() ?: []),
            $data['__telescope'] ?? []
        );
    }
916759
public function resolve($message)
    {
        $messageName = $this->messageNameResolver->resolve(
            $message
        );

        if (isset($this->mapping[$messageName])) {
            return $this->mapping[$messageName];
        }

        return [];
    }
1012127
private function getHeaders(PushMessage $message) : array
    {
        return [
            '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(),
        ];
    }
995245
public static function handle($message, $category = null)
    {

        SecurityLog::create([
            'message'  => $message,
            'category' => $category,
            'user_id'  => auth()->user() ?
                auth()->user()->id : null,
        ]);

    }
514310
public function debug($message, $category = null)
    {
        return $this->log(self::LEVEL_DEBUG, $message, $category);
    }
1264508
protected function attachments(SlackMessage $message)
    {
        return collect($message->attachments)->map(function ($attachment) use ($message) {
            return array_filter([
                'color' => $attachment->color ?: $message->color(),
                'title' => $attachment->title,
                'text' => $attachment->content,
                'fallback' => $attachment->fallback,
                'title_link' => $attachment->url,
                'fields' => $this->fields($attachment),
                'mrkdwn_in' => $attachment->markdown,
                'footer' => $attachment->footer,
                'footer_icon' => $attachment->footerIcon,
                'ts' => $attachment->timestamp,
            ]);
        })->all();
    }
1175190
private function getContents(Swift_Mime_SimpleMessage $message)
    {
        $contentType = $message->getContentType();
        switch ($contentType) {
            case 'text/plain':
                return [
                    [
                        'type'  => 'text/plain',
                        'value' => $message->getBody(),

                    ],
                ];
            case 'text/html':
                return [
                    [
                        'type'  => 'text/html',
                        'value' => $message->getBody(),
                    ],
                ];
        }

        // Following RFC 1341, text/html after text/plain in multipart
        $content = [];
        foreach ($message->getChildren() as $child) {
            if ($child instanceof Swift_MimePart && $child->getContentType() === 'text/plain') {
                $content[] = [
                    'type'  => 'text/plain',
                    'value' => $child->getBody(),
                ];
            }
        }

        if (is_null($message->getBody())) {
            return null;
        }

        $content[] = [
            'type'  => 'text/html',
            'value' => $message->getBody(),
        ];
        return $content;
    }
200179
protected function createNotification(string $title, string $message, string $type): array
    {
        if (!in_array($type, Notification::TYPES))
        {
            $allowed_types = implode(', ', Notification::TYPES);
            throw new InvalidArgumentException("Wrong notification \$type '{$type}'. Use only '{$allowed_types}' types.");
        }

        return [
            'title' => $title,
            'message' => $message,
            'type' => $type,
        ];
    }
71123
private function getMessageAckIds(array $messages)
    {
        $ackIds = [];
        foreach ($messages as $message) {
            $ackIds[] = $message->ackId();
        }

        return $ackIds;
    }
1197223
public function showAction(Message $message)
    {
        if (!$this->getUser()->getId() == $message->getReceiver()->getId()) {
            throw new AccessDeniedException('This user does not have access to this section.');
        }

        $message->setIsRead(true);
        $this->get('doctrine.orm.entity_manager')->flush();

        return array(
            'message' => $message,
        );
    }
402949
public function addLanguageItem($category, $message)
    {
        $this->_languageElements[$category][$message] = true;

        $coloredCategory = Console::ansiFormat($category, [Console::FG_YELLOW]);
        $coloredMessage = Console::ansiFormat($message, [Console::FG_YELLOW]);

        $this->stdout('Detected language element: [ ' . $coloredCategory . ' ] ' . $coloredMessage);
    }
1020276
private function getUserMessages(Message $message)
    {
        $currentUser = $this->tokenStorage->getToken()->getUser();

        return $this->om->getRepository(UserMessage::class)->findBy(['message' => $message, 'user' => $currentUser]);
    }
757200
protected function prepareMessage($message)
    {
        list($text, $level, $category, $timestamp) = $message;

        $level = Logger::getLevelName($level);
        $timestamp = date('c', $timestamp);

        $result = ArrayHelper::merge(
            $this->parseText($text),
            ['level' => $level, 'category' => $category, '@timestamp' => $timestamp]
        );

        if (isset($message[4]) === true) {
            $result['trace'] = $message[4];
        }

        return $result;
    }