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

buildClass() public method

Where possible you should give a qualified class name, that is prefixed with the package identifier. $builder->buildClass('php::depend::Parser'); To determine the correct class, 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 class is in the default package, if this is true, reuse the first class instance and ignore the default package.
  4. Create a new instance for the specified package.
public buildClass ( string $name ) : PDepend\Source\AST\ASTClass
$name string The class name.
return PDepend\Source\AST\ASTClass The created class object.
    public function buildClass($name)
    {
        $this->checkBuilderState();
        $class = new ASTClass($this->extractTypeName($name));
        $class->setCache($this->cache)->setContext($this->context)->setCompilationUnit($this->defaultCompilationUnit);
        return $class;
    }
PHPBuilder