Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
NotBabelBox | |
0.00% |
0 / 6 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
render | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
addCategories | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Contains code for inner items which are not babel boxes. |
4 | * |
5 | * @file |
6 | * @author Robert Leverington |
7 | * @author Robin Pepermans |
8 | * @author Niklas Laxström |
9 | * @author Brian Wolff |
10 | * @author Purodha Blissenbach |
11 | * @author Sam Reed |
12 | * @author Siebrand Mazeland |
13 | * @license GPL-2.0-or-later |
14 | */ |
15 | |
16 | declare( strict_types = 1 ); |
17 | |
18 | namespace MediaWiki\Babel\BabelBox; |
19 | |
20 | use MediaWiki\Parser\ParserOutput; |
21 | |
22 | /** |
23 | * Class for inner items which are not babel boxes. |
24 | */ |
25 | class NotBabelBox implements BabelBox { |
26 | private string $dir; |
27 | private string $content; |
28 | |
29 | /** |
30 | * Construct a non-babel box. |
31 | * |
32 | * @param string $dir HTML 'dir' attribute |
33 | * @param string $content What's inside the box, in wikitext format. |
34 | */ |
35 | public function __construct( string $dir, string $content ) { |
36 | $this->dir = $dir; |
37 | $this->content = $content; |
38 | } |
39 | |
40 | /** |
41 | * Return the babel box code. |
42 | * |
43 | * @return string A single non-babel box, in wikitext format. |
44 | */ |
45 | public function render(): string { |
46 | return <<<EOT |
47 | <div class="mw-babel-notabox" dir="{$this->dir}">{$this->content}</div> |
48 | EOT; |
49 | } |
50 | |
51 | public function addCategories( ParserOutput $parserOutput ): void { |
52 | } |
53 | |
54 | } |