protected function getPath($class)
    {
        foreach ($this->map as $prefix => $paths) {
            if (0 !== strpos($class, $prefix)) {
                continue;
            }

            foreach ($paths as $path) {
                $relative = ltrim(substr($class, strlen($prefix)), '\\');
                $relative = preg_replace('/\\\\+/', DIRECTORY_SEPARATOR, $relative);
                $relative .= '.php';

                if (file_exists($path . $relative)) {
                    return $path . $relative;
                }
            }
        }

        return null;
    }
protected function getPath($class)
    {
        foreach ($this->map as $prefix => $paths) {
            if (0 !== strpos($class, $prefix)) {
                continue;
            }

            foreach ($paths as $path) {
                $relative = ltrim(substr($class, strlen($prefix)), '\\');
                $relative = preg_replace('/\\\\+/', DIRECTORY_SEPARATOR, $relative);
                $relative .= '.php';

                if (file_exists($path . $relative)) {
                    return $path . $relative;
                }
            }
        }

        return null;
    }
protected function getPath ( $ class ) { foreach ( $ this -> map as $ prefix => $ paths ) { if ( 0 !== strpos ( $ class , $ prefix ) ) { continue ; } foreach ( $ paths as $ path ) { $ relative = ltrim ( substr ( $ class , strlen ( $ prefix ) ) , '\\' ) ; $ relative = preg_replace ( '/\\\\+/' , DIRECTORY_SEPARATOR , $ relative ) ; $ relative .= '.php' ; if ( file_exists ( $ path . $ relative ) ) { return $ path . $ relative ; } } } return null ; }
Returns the file path for the class name.

This method will loop through the mapped namespace prefixes to find a
directory that contains the class. If the file for the class is found,
it will be returned. Otherwise, nothing (`null`) is returned.

@param string $class The name of the class.

@return string The file path, if any.

@api
Returns the file path for the class name .