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

visitMethod() public method

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