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

buildTraitInternal() protected method

Where possible you should give a qualified trait name, that is prefixed with the package identifier. $builder->buildTrait('php::depend::Parser'); To determine the correct trait, this method implements the following algorithm.
  1. Check for an exactly matching instance and reuse it.
  2. Check for a class instance that belongs to the default package. If such an instance exists, reuse it and replace the default package with the newly given package information.
  3. Check that the requested trait is in the default package, if this is true, reuse the first trait instance and ignore the default package.
  4. Create a new instance for the specified package.
Since: 0.9.5
protected buildTraitInternal ( string $qualifiedName ) : PDepend\Source\AST\ASTTrait
$qualifiedName string
return PDepend\Source\AST\ASTTrait
    protected function buildTraitInternal($qualifiedName)
    {
        $this->internal = true;
        $trait = $this->buildTrait($qualifiedName);
        $trait->setNamespace($this->buildNamespace($this->extractNamespaceName($qualifiedName)));
        $this->restoreTrait($trait);
        return $trait;
    }
PHPBuilder