src/Php/ClassHierarchy.php
public function addClass($class, $extends = null, $implements = [])
    {
        $classId = $this->registerClass($class);
        if ($extends) {
            $parentClassId = $this->registerClass($extends);
            $this->extends[$classId] = [$parentClassId];
        }
        if (!empty($implements)) {
            $interfaceIds = [];
            foreach ($implements as $interface) {
                $interfaceIds[] = $this->registerInterface($interface);
            }
            $this->implements[$classId] = $interfaceIds;
        }
    }
public function addClass($class, $extends = null, $implements = [])
    {
        $classId = $this->registerClass($class);
        if ($extends) {
            $parentClassId = $this->registerClass($extends);
            $this->extends[$classId] = [$parentClassId];
        }
        if (!empty($implements)) {
            $interfaceIds = [];
            foreach ($implements as $interface) {
                $interfaceIds[] = $this->registerInterface($interface);
            }
            $this->implements[$classId] = $interfaceIds;
        }
    }
public function addClass ( $ class , $ extends = null , $ implements = [ ] ) { $ classId = $ this -> registerClass ( $ class ) ; if ( $ extends ) { $ parentClassId = $ this -> registerClass ( $ extends ) ; $ this -> extends [ $ classId ] = [ $ parentClassId ] ; } if ( ! empty ( $ implements ) ) { $ interfaceIds = [ ] ; foreach ( $ implements as $ interface ) { $ interfaceIds [ ] = $ this -> registerInterface ( $ interface ) ; } $ this -> implements [ $ classId ] = $ interfaceIds ; } }
add class to hierarchy tree

@param string $class
@param string $extends parent class
@param array $implements interfaces that implements
@return self
add class to hierarchy tree