src/ministruts/Module.php
private function resolveClassName($name) {
        $name = str_replace('/', '\\', trim($name));

        // no need to resolve a qualified name
        if (strContains($name, '\\'))
            return is_class($name) ? [$name] : [];

        // unqualified name, check "use" declarations
        $lowerName = strtolower($name);
        if (isset($this->uses[$lowerName]))
            return [$this->uses[$lowerName]];

        // unqualified name, check imported namespaces
        $results = [];
        foreach ($this->imports as $namespace) {
            $class = $namespace.$name;
            if (is_class($class))
                $results[] = $class;
        }
        return $results;
    }
private function resolveClassName($name) {
        $name = str_replace('/', '\\', trim($name));

        // no need to resolve a qualified name
        if (strContains($name, '\\'))
            return is_class($name) ? [$name] : [];

        // unqualified name, check "use" declarations
        $lowerName = strtolower($name);
        if (isset($this->uses[$lowerName]))
            return [$this->uses[$lowerName]];

        // unqualified name, check imported namespaces
        $results = [];
        foreach ($this->imports as $namespace) {
            $class = $namespace.$name;
            if (is_class($class))
                $results[] = $class;
        }
        return $results;
    }
private function resolveClassName ( $ name ) { $ name = str_replace ( '/' , '\\' , trim ( $ name ) ) ; // no need to resolve a qualified name if ( strContains ( $ name , '\\' ) ) return is_class ( $ name ) ? [ $ name ] : [ ] ; // unqualified name, check "use" declarations $ lowerName = strtolower ( $ name ) ; if ( isset ( $ this -> uses [ $ lowerName ] ) ) return [ $ this -> uses [ $ lowerName ] ] ; // unqualified name, check imported namespaces $ results = [ ] ; foreach ( $ this -> imports as $ namespace ) { $ class = $ namespace . $ name ; if ( is_class ( $ class ) ) $ results [ ] = $ class ; } return $ results ; }
Resolves a simple class name and returns all found fully qualified class names.

@param  string $name

@return string[] - found class names or an empty array if the class name cannot be resolved
Resolves a simple class name and returns all found fully qualified class names .