Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
MassMessageSkipLogFormatter
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
6
0.00% covered (danger)
0.00%
0 / 1
 getMessageParameters
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2
3namespace MediaWiki\MassMessage\Logging;
4
5use LogFormatter;
6use MediaWiki\MediaWikiServices;
7use Message;
8
9/**
10 * Log formatter for 'skip*' entries on Special:Log/massmessage.
11 * Parses the message summary so wikilinks work.
12 */
13
14class MassMessageSkipLogFormatter extends LogFormatter {
15
16    /**
17     * @return array
18     * @suppress PhanTypeArraySuspicious,PhanTypeArraySuspiciousNull the parent fills parsedParameters
19     */
20    protected function getMessageParameters() {
21        if ( $this->parsedParameters !== null ) {
22            return $this->parsedParameters;
23        }
24
25        parent::getMessageParameters();
26        // Format the edit summary using CommentFormatter::format so that wikilinks
27        // and other simple things get parsed, but no HTML
28        $this->parsedParameters[3] = Message::rawParam(
29            MediaWikiServices::getInstance()->getCommentFormatter()->format(
30                // @phan-suppress-next-line PhanTypeMismatchArgumentReal
31                $this->parsedParameters[3],
32                $this->entry->getTarget()
33            ) );
34
35        // Bad things happens if the numbers are not in correct order
36        ksort( $this->parsedParameters );
37        return $this->parsedParameters;
38    }
39}