public function resolveClass(FoundClass $found)
    {
        Logger::trace("Resolving class %s", $found->name);
        if ($found->name[0] === '\\') {
            return new Classname($found->name);
        }

        $classParts = explode('\\', $found->name);
        if (count($classParts) >= 2) {
            $b = array_shift($classParts);
            $baseClass = $this->originalUse->get($b);
            if ($baseClass) {
                return new Classname($baseClass . '\\' . implode('\\', $classParts));
            }
        }
        if ($c = $this->originalUse->get($found->name)) {
            Logger::trace("Found a use statement for class");
            Logger::trace("Resolved to %s", $c);
            return $c;
        } else {
            $class = Classname::build($this->getOriginalNamespace(), $found->name);
            Logger::trace("Resolved to %s", $class->classname);
            return $class;
        }
    }
public function resolveClass(FoundClass $found)
    {
        Logger::trace("Resolving class %s", $found->name);
        if ($found->name[0] === '\\') {
            return new Classname($found->name);
        }

        $classParts = explode('\\', $found->name);
        if (count($classParts) >= 2) {
            $b = array_shift($classParts);
            $baseClass = $this->originalUse->get($b);
            if ($baseClass) {
                return new Classname($baseClass . '\\' . implode('\\', $classParts));
            }
        }
        if ($c = $this->originalUse->get($found->name)) {
            Logger::trace("Found a use statement for class");
            Logger::trace("Resolved to %s", $c);
            return $c;
        } else {
            $class = Classname::build($this->getOriginalNamespace(), $found->name);
            Logger::trace("Resolved to %s", $class->classname);
            return $class;
        }
    }
public function resolveClass ( FoundClass $ found ) { Logger :: trace ( "Resolving class %s" , $ found -> name ) ; if ( $ found -> name [ 0 ] === '\\' ) { return new Classname ( $ found -> name ) ; } $ classParts = explode ( '\\' , $ found -> name ) ; if ( count ( $ classParts ) >= 2 ) { $ b = array_shift ( $ classParts ) ; $ baseClass = $ this -> originalUse -> get ( $ b ) ; if ( $ baseClass ) { return new Classname ( $ baseClass . '\\' . implode ( '\\' , $ classParts ) ) ; } } if ( $ c = $ this -> originalUse -> get ( $ found -> name ) ) { Logger :: trace ( "Found a use statement for class" ) ; Logger :: trace ( "Resolved to %s" , $ c ) ; return $ c ; } else { $ class = Classname :: build ( $ this -> getOriginalNamespace ( ) , $ found -> name ) ; Logger :: trace ( "Resolved to %s" , $ class -> classname ) ; return $ class ; } }
Resolves a class to it's fully-qualified using a few different mechanisms. If the class
begins with a slash, we assume that it is already qualified. If the class exists in the list
of use-statements, then we resolve the fully qualified name using the uses. Lastly, if the
class doesn't begin with a slash or exist as a use-statement, we resolve the name using the
namespace of the current class.

@param $found FoundClass the found class to resolve
@return bool|Classname
Resolves a class to it s fully - qualified using a few different mechanisms . If the class begins with a slash we assume that it is already qualified . If the class exists in the list of use - statements then we resolve the fully qualified name using the uses . Lastly if the class doesn t begin with a slash or exist as a use - statement we resolve the name using the namespace of the current class .