Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
FatMessage
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 2
12
0.00% covered (danger)
0.00%
0 / 1
 setTranslation
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 translation
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
6
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\MessageLoading;
5
6/**
7 * Message object where you can directly set the translation.
8 * Hence the name fat. Authors are not supported.
9 *
10 * @author Niklas Laxström
11 * @copyright Copyright © 2008-2010, Niklas Laxström
12 * @license GPL-2.0-or-later
13 */
14class FatMessage extends Message {
15    /** Stored translation. */
16    protected ?string $translation = null;
17
18    /** Set the current translation of this message. */
19    public function setTranslation( ?string $text ): void {
20        $this->translation = $text;
21    }
22
23    public function translation(): ?string {
24        if ( $this->translation === null ) {
25            return $this->infile;
26        }
27
28        return $this->translation;
29    }
30}