PDepend\Source\AST\AbstractASTType::getTraitMethods PHP Method

getTraitMethods() protected method

Returns an array with {@link \PDepend\Source\AST\ASTMethod} objects that are imported through traits.
Since: 1.0.0
protected getTraitMethods ( ) : PDepend\Source\AST\ASTMethod[]
return PDepend\Source\AST\ASTMethod[]
    protected function getTraitMethods()
    {
        $methods = array();
        $uses = $this->findChildrenOfType('PDepend\\Source\\AST\\ASTTraitUseStatement');
        foreach ($uses as $use) {
            foreach ($use->getAllMethods() as $method) {
                foreach ($uses as $use2) {
                    if ($use2->hasExcludeFor($method)) {
                        continue 2;
                    }
                }
                $name = strtolower($method->getName());
                if (false === isset($methods[$name])) {
                    $methods[$name] = $method;
                    continue;
                }
                if ($methods[$name]->isAbstract()) {
                    $methods[$name] = $method;
                    continue;
                }
                if ($method->isAbstract()) {
                    continue;
                }
                throw new ASTTraitMethodCollisionException($method, $this);
            }
        }
        return $methods;
    }