PDepend\Report\Summary\Xml::generateTypeXml PHP Метод

generateTypeXml() приватный Метод

Generates the XML for a class or trait node.
private generateTypeXml ( PDepend\Source\AST\ASTClass $type, string $typeIdentifier ) : void
$type PDepend\Source\AST\ASTClass
$typeIdentifier string
Результат void
    private function generateTypeXml(ASTClass $type, $typeIdentifier)
    {
        if (!$type->isUserDefined()) {
            return;
        }
        $xml = end($this->xmlStack);
        $doc = $xml->ownerDocument;
        $typeXml = $doc->createElement($typeIdentifier);
        $typeXml->setAttribute('name', Utf8Util::ensureEncoding($type->getName()));
        $typeXml->setAttribute('start', Utf8Util::ensureEncoding($type->getStartLine()));
        $typeXml->setAttribute('end', Utf8Util::ensureEncoding($type->getEndLine()));
        $this->writeNodeMetrics($typeXml, $type);
        $this->writeFileReference($typeXml, $type->getCompilationUnit());
        $xml->appendChild($typeXml);
        array_push($this->xmlStack, $typeXml);
        foreach ($type->getMethods() as $method) {
            $method->accept($this);
        }
        foreach ($type->getProperties() as $property) {
            $property->accept($this);
        }
        array_pop($this->xmlStack);
    }