PDepend\Report\Summary\Xml::visitFunction PHP Method

visitFunction() public method

Visits a function node.
public visitFunction ( PDepend\Source\AST\ASTFunction $function ) : void
$function PDepend\Source\AST\ASTFunction
return void
    public function visitFunction(ASTFunction $function)
    {
        $xml = end($this->xmlStack);
        $doc = $xml->ownerDocument;
        $functionXml = $doc->createElement('function');
        $functionXml->setAttribute('name', Utf8Util::ensureEncoding($function->getName()));
        $functionXml->setAttribute('start', Utf8Util::ensureEncoding($function->getStartLine()));
        $functionXml->setAttribute('end', Utf8Util::ensureEncoding($function->getEndLine()));
        $this->writeNodeMetrics($functionXml, $function);
        $this->writeFileReference($functionXml, $function->getCompilationUnit());
        $xml->appendChild($functionXml);
    }