Loader/PsrLoader.php
public function loadClass($className)
    {

        foreach ($this->definitions as $def) {

            $nameSpace = $def->getNameSpace();
            $path = $def->getPath();
            $name = $className;
            if ($nameSpace) {

                $ns = rtrim($nameSpace, '\\').'\\';

                $nameLen = strlen($className);
                $nsLen = strlen($ns);

                if ($nameLen < $nsLen || substr($className, 0, $nsLen) !== $ns)
                    return false;

                $name = substr($name, $nsLen);
            }

            $ds = DIRECTORY_SEPARATOR;
            $path = $path ? $path.$ds : '';
            $path .= str_replace(['_', '\\'], $ds, $name).'.php';

            if (($path = stream_resolve_include_path($path)) !== false)
                include $path;

            if (class_exists($className, false))
                return true;
        }

        return false;
    }
public function loadClass($className)
    {

        foreach ($this->definitions as $def) {

            $nameSpace = $def->getNameSpace();
            $path = $def->getPath();
            $name = $className;
            if ($nameSpace) {

                $ns = rtrim($nameSpace, '\\').'\\';

                $nameLen = strlen($className);
                $nsLen = strlen($ns);

                if ($nameLen < $nsLen || substr($className, 0, $nsLen) !== $ns)
                    return false;

                $name = substr($name, $nsLen);
            }

            $ds = DIRECTORY_SEPARATOR;
            $path = $path ? $path.$ds : '';
            $path .= str_replace(['_', '\\'], $ds, $name).'.php';

            if (($path = stream_resolve_include_path($path)) !== false)
                include $path;

            if (class_exists($className, false))
                return true;
        }

        return false;
    }
public function loadClass ( $ className ) { foreach ( $ this -> definitions as $ def ) { $ nameSpace = $ def -> getNameSpace ( ) ; $ path = $ def -> getPath ( ) ; $ name = $ className ; if ( $ nameSpace ) { $ ns = rtrim ( $ nameSpace , '\\' ) . '\\' ; $ nameLen = strlen ( $ className ) ; $ nsLen = strlen ( $ ns ) ; if ( $ nameLen < $ nsLen || substr ( $ className , 0 , $ nsLen ) !== $ ns ) return false ; $ name = substr ( $ name , $ nsLen ) ; } $ ds = DIRECTORY_SEPARATOR ; $ path = $ path ? $ path . $ ds : '' ; $ path .= str_replace ( [ '_' , '\\' ] , $ ds , $ name ) . '.php' ; if ( ( $ path = stream_resolve_include_path ( $ path ) ) !== false ) include $ path ; if ( class_exists ( $ className , false ) ) return true ; } return false ; }
Loads a class based on its class name.

If it's not found, it's simply ignored in order to let another loader try to load it
If it's the only loader, an error will be thrown after a failed loading

There's no loader recursion, the final check uses the second parameter of class_exists() to
not trigger another autoloader inside this one

@param string $className The FQCN of the class to load

@return bool Has the class been loaded or not
Loads a class based on its class name .