public getMethods ( ) : PDepend\Source\AST\ASTMethod[] | ||
return | PDepend\Source\AST\ASTMethod[] |
public function getMethods()
{
if (is_array($this->methods)) {
return new ASTArtifactList($this->methods);
}
$methods = (array) $this->cache->type('methods')->restore($this->getId());
foreach ($methods as $method) {
$method->compilationUnit = $this->compilationUnit;
$method->setParent($this);
}
return new ASTArtifactList($methods);
}
/** * Calculates the Weight Method Per Class metric. * * @param \PDepend\Source\AST\AbstractASTType $type * @return integer[] * @since 1.0.6 */ private function calculateWmci(AbstractASTType $type) { $ccn = array(); foreach ($type->getMethods() as $method) { $ccn[$method->getName()] = $this->cyclomaticAnalyzer->getCcn2($method); } return $ccn; }