mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
Proper class type for DataMw
Slowly inch toward replacing the plethora of `stdClass` in the Parsoid port with proper types. The new classes could use additional documentation of the various properties, but this is a start. Bug: T226428 Change-Id: I87e73243203145b4067e70b0fa9e30da054fe1ed
This commit is contained in:
parent
4ed31f499e
commit
dadeca74b5
|
@ -15,6 +15,7 @@ use Wikimedia\Parsoid\Ext\ExtensionTagHandler;
|
|||
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
|
||||
use Wikimedia\Parsoid\Ext\PHPUtils;
|
||||
use Wikimedia\Parsoid\Ext\WTUtils;
|
||||
use Wikimedia\Parsoid\NodeData\DataMw;
|
||||
use Wikimedia\Parsoid\NodeData\DataParsoid;
|
||||
use Wikimedia\Parsoid\Utils\DOMCompat;
|
||||
|
||||
|
@ -81,10 +82,10 @@ class References extends ExtensionTagHandler {
|
|||
'typeof' => 'mw:Extension/references',
|
||||
'about' => $extApi->newAboutId()
|
||||
] );
|
||||
$dataMw = (object)[
|
||||
$dataMw = new DataMw( [
|
||||
'name' => 'references',
|
||||
'attrs' => new stdClass
|
||||
];
|
||||
] );
|
||||
// Dont emit empty keys
|
||||
if ( $refsOpts['group'] ) {
|
||||
$dataMw->attrs->group = $refsOpts['group'];
|
||||
|
|
Loading…
Reference in a new issue