src/FACTFinder/Loader.php
public static function getClassName($name)
    {
        $name = trim(preg_replace('/^FACTFinder\\\\/i', '', $name));

        // check whether there is a custom or lib-unrelated class
        $customClassName     = 'FACTFinder\Custom\\' . $name;
        $factfinderClassName = 'FACTFinder\\' . $name;
        $defaultClassName    = $name;

        if (self::$loadCustomClasses && class_exists($customClassName))
            $className = $customClassName;
        else if (class_exists($factfinderClassName))
            $className = $factfinderClassName;
        else if (class_exists($defaultClassName))
            $className = $defaultClassName;
        else
            throw new \Exception("class '$factfinderClassName' not found");
        return $className;
    }
public static function getClassName($name)
    {
        $name = trim(preg_replace('/^FACTFinder\\\\/i', '', $name));

        // check whether there is a custom or lib-unrelated class
        $customClassName     = 'FACTFinder\Custom\\' . $name;
        $factfinderClassName = 'FACTFinder\\' . $name;
        $defaultClassName    = $name;

        if (self::$loadCustomClasses && class_exists($customClassName))
            $className = $customClassName;
        else if (class_exists($factfinderClassName))
            $className = $factfinderClassName;
        else if (class_exists($defaultClassName))
            $className = $defaultClassName;
        else
            throw new \Exception("class '$factfinderClassName' not found");
        return $className;
    }
Expects a fully qualified class name. if the leading namespace is omitted
or "FACTFinder", we first check whether there is a custom class in
namespace "FACTFinder\Custom\", then we look in "FACTFinder\". If none of
them exist, it also checks if the name is the class name itself.
Note that classes in the \Custom namespace should inherit the class they
overwrite - otherwise some of the type hinting within the library might
break.

@param string $name The class name to be resolved.

@return string The class name to be used.