PDepend\Metrics\Analyzer\InheritanceAnalyzer::getNodeMetrics PHP Метод

getNodeMetrics() публичный Метод

This method will return an array with all generated metric values for the given $node. If there are no metrics for the requested node, this method will return an empty array.
public getNodeMetrics ( PDepend\Source\AST\ASTArtifact $artifact ) : array(string=>mixed)
$artifact PDepend\Source\AST\ASTArtifact
Результат array(string=>mixed)
    public function getNodeMetrics(ASTArtifact $artifact)
    {
        if (isset($this->nodeMetrics[$artifact->getId()])) {
            return $this->nodeMetrics[$artifact->getId()];
        }
        return array();
    }

Usage Example

 /**
  * testAnalyzerNotCountsImplementedInterfaceMethodsAsOverwritten
  *
  * @return void
  */
 public function testAnalyzerNotCountsImplementedInterfaceMethodsAsOverwritten()
 {
     $namespaces = self::parseCodeResourceForTest();
     $class = $namespaces->current()->getClasses()->current();
     $analyzer = new InheritanceAnalyzer();
     $analyzer->analyze($namespaces);
     $metrics = $analyzer->getNodeMetrics($class);
     $this->assertEquals(1, $metrics['noom']);
 }