Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
LqtImportFormatter
0.00% covered (danger)
0.00%
0 / 21
0.00% covered (danger)
0.00%
0 / 2
30
0.00% covered (danger)
0.00%
0 / 1
 getPreloadTitles
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
6
 getActionMessage
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2
3namespace Flow\Log;
4
5use MediaWiki\Message\Message;
6use MediaWiki\Title\Title;
7
8class LqtImportFormatter extends \LogFormatter {
9
10    public function getPreloadTitles() {
11        $titles = [ $this->entry->getTarget() ];
12        $params = $this->entry->getParameters() + [
13            'topic' => '',
14        ];
15        $topic = Title::newFromText( $params['topic'] );
16        if ( $topic ) {
17            $titles[] = $topic;
18        }
19
20        return $titles;
21    }
22
23    /**
24     * Formats an activity log entry.
25     *
26     * @return string The log entry
27     */
28    protected function getActionMessage() {
29        $board = $this->entry->getTarget();
30        $params = $this->entry->getParameters() + [
31            'topic' => '',
32            'lqt_subject' => '',
33        ];
34        $topic = Title::newFromText( $params['topic'] );
35
36        $message = $this->msg( "logentry-import-lqt-to-flow-topic" )
37            ->params(
38                $topic ? $topic->getPrefixedText() : '',
39                Message::plaintextParam( $params['lqt_subject'] ),
40                $board->getPrefixedText()
41            );
42
43        return $this->plaintext ? $message->text() : $message->parse();
44    }
45}