ApiGen\Generator\TemplateGenerators\TreeGenerator::addToTreeByReflection PHP Method

addToTreeByReflection() private method

private addToTreeByReflection ( ApiGen\Contracts\Parser\Reflection\ClassReflectionInterface $reflection )
$reflection ApiGen\Contracts\Parser\Reflection\ClassReflectionInterface
    private function addToTreeByReflection(ClassReflectionInterface $reflection)
    {
        $type = $this->getTypeByReflection($reflection);
        if ($reflection->getParentClassName() === null) {
            $name = $reflection->getName();
            $this->treeStorage[$type][$name] = [];
            $this->processed[$name] = true;
            return;
        }
        $parents = array_values(array_reverse($reflection->getParentClasses()));
        $cursor =& $this->treeStorage[$type];
        foreach ($parents as $level => $parent) {
            $name = $parent->getName();
            if (!isset($cursor[$name])) {
                $cursor[$name] = [];
                $this->processed[$name] = true;
            }
            $cursor[$name][$reflection->getName()] = [];
            // Traverse down the tree.
            $cursor =& $cursor[$name];
        }
    }