src/Rocketeer/Services/Builders/Builder.php
public function findQualifiedName($class, $type, $namespace = null)
    {
        // Check if we already resolved that name
        if (array_key_exists($class, $this->lookedUp)) {
            return $this->lookedUp[$type][$class];
        }

        $paths = $this->getLookups($type);
        $paths[] = '%s';

        // Create classes array
        $class = ucfirst($class);
        $classes = $namespace ? [ucfirst($namespace).'\\'.$class, $class] : [$class];

        // Search for first existing class
        $qualified = false;
        foreach ($classes as $class) {
            foreach ($paths as $path) {
                $path = sprintf($path, $class);
                if (class_exists($path)) {
                    $qualified = $path;
                    break 2;
                }
            }
        }

        return $this->lookedUp[$type][$class] = $qualified;
    }
public function findQualifiedName($class, $type, $namespace = null)
    {
        // Check if we already resolved that name
        if (array_key_exists($class, $this->lookedUp)) {
            return $this->lookedUp[$type][$class];
        }

        $paths = $this->getLookups($type);
        $paths[] = '%s';

        // Create classes array
        $class = ucfirst($class);
        $classes = $namespace ? [ucfirst($namespace).'\\'.$class, $class] : [$class];

        // Search for first existing class
        $qualified = false;
        foreach ($classes as $class) {
            foreach ($paths as $path) {
                $path = sprintf($path, $class);
                if (class_exists($path)) {
                    $qualified = $path;
                    break 2;
                }
            }
        }

        return $this->lookedUp[$type][$class] = $qualified;
    }
public function findQualifiedName ( $ class , $ type , $ namespace = null ) { // Check if we already resolved that name if ( array_key_exists ( $ class , $ this -> lookedUp ) ) { return $ this -> lookedUp [ $ type ] [ $ class ] ; } $ paths = $ this -> getLookups ( $ type ) ; $ paths [ ] = '%s' ; // Create classes array $ class = ucfirst ( $ class ) ; $ classes = $ namespace ? [ ucfirst ( $ namespace ) . '\\' . $ class , $ class ] : [ $ class ] ; // Search for first existing class $ qualified = false ; foreach ( $ classes as $ class ) { foreach ( $ paths as $ path ) { $ path = sprintf ( $ path , $ class ) ; if ( class_exists ( $ path ) ) { $ qualified = $ path ; break 2 ; } } } return $ this -> lookedUp [ $ type ] [ $ class ] = $ qualified ; }
Find a class in various predefined namespaces.

@param string      $class
@param string      $type
@param string|null $namespace

@return false|string
Find a class in various predefined namespaces .