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
MMLmfrac
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: "mfrac"
8 * description: "form a fraction from two sub-expressions"
9 * category: "General Layout Schemata"
10 */
11class MMLmfrac extends MMLbase {
12
13    public function __construct( string $texclass = "", array $attributes = [] ) {
14        parent::__construct( 'mfrac', $texclass, $attributes );
15    }
16
17    /**
18     * Creates a new subtree element with base and scripts
19     * @param MMLbase $numerator Top portion of the fraction
20     * @param MMLbase $denominator Bottom portion of the fraction
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 ordered as:
24     *    [base, postsubscript, postsuperscript, presubscript, presuperscript]
25     */
26    public static function newSubtree( MMLbase $numerator,
27                                       MMLbase $denominator,
28                                       string $texclass = "",
29                                       array $attributes = [] ) {
30        $instance = new self( $texclass, $attributes );
31        $instance->children = [ $numerator, $denominator ];
32        return $instance;
33    }
34}