Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| NotBabelBox | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
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 | /** |
| 27 | * Construct a non-babel box. |
| 28 | * |
| 29 | * @param string $dir HTML 'dir' attribute |
| 30 | * @param string $content What's inside the box, in wikitext format. |
| 31 | */ |
| 32 | public function __construct( |
| 33 | private readonly string $dir, |
| 34 | private readonly string $content, |
| 35 | ) { |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Return the babel box code. |
| 40 | * |
| 41 | * @return string A single non-babel box, in wikitext format. |
| 42 | */ |
| 43 | public function render(): string { |
| 44 | return <<<EOT |
| 45 | <div class="mw-babel-notabox" dir="{$this->dir}">{$this->content}</div> |
| 46 | EOT; |
| 47 | } |
| 48 | |
| 49 | public function addCategories( ParserOutput $parserOutput ): void { |
| 50 | } |
| 51 | |
| 52 | } |