FOF30\Autoloader\Autoloader::setMap PHP Метод

setMap() публичный Метод

Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.
public setMap ( string $prefix, array | string $paths ) : void
$prefix string The prefix/namespace, with trailing '\\'
$paths array | string The PSR-4 base directories
Результат void
    public function setMap($prefix, $paths)
    {
        if ($prefix) {
            $prefix = ltrim($prefix, '\\');
        }
        if (!$prefix) {
            $this->fallbackDirs = (array) $paths;
        } else {
            $length = strlen($prefix);
            if ('\\' !== $prefix[$length - 1]) {
                throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
            }
            $this->prefixLengths[$prefix[0]][$prefix] = $length;
            $this->prefixDirs[$prefix] = (array) $paths;
        }
    }