Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
63.64% |
7 / 11 |
|
85.71% |
6 / 7 |
CRAP | |
0.00% |
0 / 1 |
Curly | |
63.64% |
7 / 11 |
|
85.71% |
6 / 7 |
11.08 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getArg | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
render | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
renderMML | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
inCurlies | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
extractSubscripts | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getModIdent | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare( strict_types = 1 ); |
4 | |
5 | namespace MediaWiki\Extension\Math\WikiTexVC\Nodes; |
6 | |
7 | use MediaWiki\Extension\Math\WikiTexVC\MMLnodes\MMLmrow; |
8 | |
9 | class Curly extends TexNode { |
10 | |
11 | /** @var TexArray */ |
12 | private $arg; |
13 | |
14 | public function __construct( TexArray $arg ) { |
15 | parent::__construct( $arg ); |
16 | $this->arg = $arg; |
17 | } |
18 | |
19 | /** |
20 | * @return TexArray |
21 | */ |
22 | public function getArg(): TexArray { |
23 | return $this->arg; |
24 | } |
25 | |
26 | public function render() { |
27 | return $this->arg->inCurlies(); |
28 | } |
29 | |
30 | public function renderMML( $arguments = [], $state = [] ) { |
31 | if ( count( $this->arg->getArgs() ) > 1 ) { |
32 | $mmlRow = new MMLmrow(); |
33 | return $mmlRow->encapsulateRaw( parent::renderMML( $arguments, $state ) ); |
34 | } |
35 | |
36 | return parent::renderMML( $arguments, $state ); |
37 | } |
38 | |
39 | public function inCurlies() { |
40 | return $this->render(); |
41 | } |
42 | |
43 | public function extractSubscripts() { |
44 | return $this->arg->extractSubscripts(); |
45 | } |
46 | |
47 | public function getModIdent() { |
48 | return $this->arg->getModIdent(); |
49 | } |
50 | |
51 | } |