Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
DataMw | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\NodeData; |
5 | |
6 | use stdClass; |
7 | |
8 | /** |
9 | * Editing data for a DOM node. Managed by DOMDataUtils::get/setDataMw(). |
10 | * |
11 | * To reduce memory usage, most of the properties need to be dynamic, but |
12 | * we use the property declarations below to allow type checking. |
13 | * |
14 | * @property list<string|stdClass> $parts |
15 | * @property string $name |
16 | * @property string $extPrefix |
17 | * @property string $extSuffix |
18 | * @property list $attribs |
19 | * @property string $src |
20 | * @property string $caption |
21 | * @property string $thumb |
22 | * @property bool $autoGenerated |
23 | * @property list $errors |
24 | * @property stdClass $body |
25 | * @property mixed $html |
26 | * @property float $scale |
27 | * @property string $starttime |
28 | * @property string $endtime |
29 | * @property string $thumbtime |
30 | * @property string $page |
31 | * == Annotations == |
32 | * @property string $rangeId |
33 | * @property list<int> $wtOffsets |
34 | * @property bool $extendedRange |
35 | * @property stdClass $attrs |
36 | */ |
37 | #[\AllowDynamicProperties] |
38 | class DataMw { |
39 | public function __construct( array $initialVals = [] ) { |
40 | foreach ( $initialVals as $k => $v ) { |
41 | // @phan-suppress-next-line PhanNoopSwitchCases |
42 | switch ( $k ) { |
43 | // Add cases here for components which should be instantiated |
44 | // as proper classes. |
45 | default: |
46 | $this->$k = $v; |
47 | break; |
48 | } |
49 | } |
50 | } |
51 | } |