Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| MMLmsup | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| newSubtree | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\Math\WikiTexVC\MMLnodes; |
| 4 | |
| 5 | /** |
| 6 | * Presentation MathML 3 Element |
| 7 | * name: "msup" |
| 8 | * description: "attach a superscript to a base" |
| 9 | * category: "Script and Limit Schemata" |
| 10 | */ |
| 11 | class MMLmsup extends MMLbase { |
| 12 | public function __construct( string $texclass = "", array $attributes = [] ) { |
| 13 | parent::__construct( "msup", $texclass, $attributes ); |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Creates a new subtree element with base and scripts |
| 18 | * @param MMLbase|string $base Main content element |
| 19 | * @param MMLbase|string $superscript Element placed above the base (superscript) |
| 20 | * @param string $texclass Optional TeX class for styling |
| 21 | * @param array $attributes Additional HTML attributes for the element |
| 22 | * @return static New instance with children in order: [base, superscript] |
| 23 | */ |
| 24 | public static function newSubtree( $base, |
| 25 | $superscript, |
| 26 | string $texclass = "", |
| 27 | array $attributes = [] ) { |
| 28 | $instance = new self( $texclass, $attributes ); |
| 29 | $instance->children = [ $base, $superscript ]; |
| 30 | return $instance; |
| 31 | } |
| 32 | } |