/** * Returns all properties for this class. * * @return \PDepend\Source\AST\ASTProperty[] */ public function getProperties() { if ($this->properties === null) { $this->properties = array(); $declarations = $this->findChildrenOfType('PDepend\\Source\\AST\\ASTFieldDeclaration'); foreach ($declarations as $declaration) { $declarators = $declaration->findChildrenOfType('PDepend\\Source\\AST\\ASTVariableDeclarator'); foreach ($declarators as $declarator) { $property = new ASTProperty($declaration, $declarator); $property->setDeclaringClass($this); $property->setCompilationUnit($this->getCompilationUnit()); $this->properties[] = $property; } } } return new ASTArtifactList($this->properties); }
/** * Visits a property node. * * @param \PDepend\Source\AST\ASTProperty $property * @return void */ public function visitProperty(ASTProperty $property) { $this->visits[] = $property->getName(); parent::visitProperty($property); }