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