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 ParserOutput; |
21 | |
22 | /** |
23 | * Class for inner items which are not babel boxes. |
24 | */ |
25 | class NotBabelBox implements BabelBox { |
26 | |
27 | /** |
28 | * @var string |
29 | */ |
30 | private $dir; |
31 | |
32 | /** |
33 | * @var string |
34 | */ |
35 | private $content; |
36 | |
37 | /** |
38 | * Construct a non-babel box. |
39 | * |
40 | * @param string $dir HTML 'dir' attribute |
41 | * @param string $content What's inside the box, in wikitext format. |
42 | */ |
43 | public function __construct( string $dir, string $content ) { |
44 | $this->dir = $dir; |
45 | $this->content = $content; |
46 | } |
47 | |
48 | /** |
49 | * Return the babel box code. |
50 | * |
51 | * @return string A single non-babel box, in wikitext format. |
52 | */ |
53 | public function render(): string { |
54 | return <<<EOT |
55 | <div class="mw-babel-notabox" dir="{$this->dir}">{$this->content}</div> |
56 | EOT; |
57 | } |
58 | |
59 | public function addCategories( ParserOutput $parserOutput ): void { |
60 | } |
61 | |
62 | } |