PDepend\Source\Language\PHP\PHPBuilder::getTrait PHP Method

getTrait() public method

This method will try to find an already existing instance for the given qualified name. It will create a new {@link \PDepend\Source\AST\ASTTrait} instance when no matching type exists.
Since: 1.0.0
public getTrait ( string $qualifiedName ) : PDepend\Source\AST\ASTTrait
$qualifiedName string
return PDepend\Source\AST\ASTTrait
    public function getTrait($qualifiedName)
    {
        $trait = $this->findTrait($qualifiedName);
        if ($trait === null) {
            $trait = $this->buildTraitInternal($qualifiedName);
        }
        return $trait;
    }
PHPBuilder