FatalErrorHandler/ClassNotFoundFatalErrorHandler.php
private function getClassCandidates($class)
    {
        if (!is_array($functions = spl_autoload_functions())) {
            return array();
        }

        // find Symfony and Composer autoloaders
        $classes = array();

        foreach ($functions as $function) {
            if (!is_array($function)) {
                continue;
            }
            // get class loaders wrapped by DebugClassLoader
            if ($function[0] instanceof DebugClassLoader) {
                $function = $function[0]->getClassLoader();

                if (!is_array($function)) {
                    continue;
                }
            }

            if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) {
                foreach ($function[0]->getPrefixes() as $prefix => $paths) {
                    foreach ($paths as $path) {
                        $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
                    }
                }
            }
            if ($function[0] instanceof ComposerClassLoader) {
                foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
                    foreach ($paths as $path) {
                        $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
                    }
                }
            }
        }

        return array_unique($classes);
    }
private function getClassCandidates($class)
    {
        if (!is_array($functions = spl_autoload_functions())) {
            return array();
        }

        // find Symfony and Composer autoloaders
        $classes = array();

        foreach ($functions as $function) {
            if (!is_array($function)) {
                continue;
            }
            // get class loaders wrapped by DebugClassLoader
            if ($function[0] instanceof DebugClassLoader) {
                $function = $function[0]->getClassLoader();

                if (!is_array($function)) {
                    continue;
                }
            }

            if ($function[0] instanceof ComposerClassLoader || $function[0] instanceof SymfonyClassLoader) {
                foreach ($function[0]->getPrefixes() as $prefix => $paths) {
                    foreach ($paths as $path) {
                        $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
                    }
                }
            }
            if ($function[0] instanceof ComposerClassLoader) {
                foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
                    foreach ($paths as $path) {
                        $classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
                    }
                }
            }
        }

        return array_unique($classes);
    }
private function getClassCandidates ( $ class ) { if ( ! is_array ( $ functions = spl_autoload_functions ( ) ) ) { return array ( ) ; } // find Symfony and Composer autoloaders $ classes = array ( ) ; foreach ( $ functions as $ function ) { if ( ! is_array ( $ function ) ) { continue ; } // get class loaders wrapped by DebugClassLoader if ( $ function [ 0 ] instanceof DebugClassLoader ) { $ function = $ function [ 0 ] -> getClassLoader ( ) ; if ( ! is_array ( $ function ) ) { continue ; } } if ( $ function [ 0 ] instanceof ComposerClassLoader || $ function [ 0 ] instanceof SymfonyClassLoader ) { foreach ( $ function [ 0 ] -> getPrefixes ( ) as $ prefix => $ paths ) { foreach ( $ paths as $ path ) { $ classes = array_merge ( $ classes , $ this -> findClassInPath ( $ path , $ class , $ prefix ) ) ; } } } if ( $ function [ 0 ] instanceof ComposerClassLoader ) { foreach ( $ function [ 0 ] -> getPrefixesPsr4 ( ) as $ prefix => $ paths ) { foreach ( $ paths as $ path ) { $ classes = array_merge ( $ classes , $ this -> findClassInPath ( $ path , $ class , $ prefix ) ) ; } } } } return array_unique ( $ classes ) ; }
Tries to guess the full namespace for a given class name.

By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
autoloader (that should cover all common cases).

@param string $class A class name (without its namespace)

@return array An array of possible fully qualified class names
Tries to guess the full namespace for a given class name .