public function registerPath($namespace, $path, $prepend = false)
    {
        $namespace = Normalizer::ns($namespace, true);
        $index     = substr($namespace, 0, 4);

        $this->indexes[$index] = true;

        $path = Normalizer::path($path, true);

        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        if ($prepend) {
            array_unshift($this->paths[$namespace], $path);

            return $this;
        }
        array_push($this->paths[$namespace], $path);

        return $this;
    }
public function registerPath($namespace, $path, $prepend = false)
    {
        $namespace = Normalizer::ns($namespace, true);
        $index     = substr($namespace, 0, 4);

        $this->indexes[$index] = true;

        $path = Normalizer::path($path, true);

        if (! isset($this->paths[$namespace])) {
            $this->paths[$namespace] = [];
        }
        if ($prepend) {
            array_unshift($this->paths[$namespace], $path);

            return $this;
        }
        array_push($this->paths[$namespace], $path);

        return $this;
    }
public function registerPath ( $ namespace , $ path , $ prepend = false ) { $ namespace = Normalizer :: ns ( $ namespace , true ) ; $ index = substr ( $ namespace , 0 , 4 ) ; $ this -> indexes [ $ index ] = true ; $ path = Normalizer :: path ( $ path , true ) ; if ( ! isset ( $ this -> paths [ $ namespace ] ) ) { $ this -> paths [ $ namespace ] = [ ] ; } if ( $ prepend ) { array_unshift ( $ this -> paths [ $ namespace ] , $ path ) ; return $ this ; } array_push ( $ this -> paths [ $ namespace ] , $ path ) ; return $ this ; }
Registers a PSR-4 directory for a given namespace.

@param string $namespace The namespace
@param string $path      The PSR-4 root directory
@param bool   $prepend   Whether to prepend the directories

@return self
Registers a PSR - 4 directory for a given namespace .