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
MMLmroot
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: "mroot"
8 * description: "form a radical with specified index"
9 * category: "General Layout Schemata"
10 */
11class MMLmroot extends MMLbase {
12
13    public function __construct( string $texclass = "", array $attributes = [] ) {
14        parent::__construct( "mroot", $texclass, $attributes );
15    }
16
17    /**
18     * Creates a new subtree element with base and scripts
19     * @param MMLbase $base Radicand
20     * @param MMLbase $index Root degree
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, index]
24     */
25    public static function newSubtree( MMLbase $base,
26                                       MMLbase $index,
27                                       string $texclass = "",
28                                       array $attributes = [] ) {
29        $instance = new self( $texclass, $attributes );
30        $instance->children = [ $base, $index ];
31        return $instance;
32    }
33}