public function __construct($name, $xmlFile) { $doc = new \DOMDocument(); $doc->load($xmlFile); /** @var \DOMElement $root */ $root = $doc->childNodes->item(0); parent::__construct($name, ['ahh' => $root->getAttribute('ahh'), 'andc' => $root->getAttribute('andc'), 'calls' => $root->getAttribute('calls'), 'ccn' => $root->getAttribute('ccn'), 'ccn2' => $root->getAttribute('ccn2'), 'cloc' => $root->getAttribute('cloc'), 'clsa' => $root->getAttribute('clsa'), 'clsc' => $root->getAttribute('clsc'), 'eloc' => $root->getAttribute('eloc'), 'fanout' => $root->getAttribute('fanout'), 'leafs' => $root->getAttribute('leafs'), 'lloc' => $root->getAttribute('lloc'), 'loc' => $root->getAttribute('loc'), 'maxDIT' => $root->getAttribute('maxDIT'), 'ncloc' => $root->getAttribute('ncloc'), 'roots' => $root->getAttribute('roots')]); foreach ($root->childNodes as $node) { if ($node->nodeName == 'package') { $this->addChild($this->parsePackage($node)); } } }
public function __construct($name, $type, $data = []) { parent::__construct($name, $data); $this->type = $type; }