public function add($prefix, $dir, $prepend = false)
    {
        $prefix = trim($prefix, '\\') . '\\';
        $dir = rtrim($dir, DIRECTORY_SEPARATOR) . '/';

        if (isset($this->prefixes[$prefix]) === false) {
            $this->prefixes[$prefix] = [];
        }

        if ($prepend) {
            array_unshift($this->prefixes[$prefix], $dir);
        } else {
            array_push($this->prefixes[$prefix], $dir);
        }

        return $this;
    }
public function add($prefix, $dir, $prepend = false)
    {
        $prefix = trim($prefix, '\\') . '\\';
        $dir = rtrim($dir, DIRECTORY_SEPARATOR) . '/';

        if (isset($this->prefixes[$prefix]) === false) {
            $this->prefixes[$prefix] = [];
        }

        if ($prepend) {
            array_unshift($this->prefixes[$prefix], $dir);
        } else {
            array_push($this->prefixes[$prefix], $dir);
        }

        return $this;
    }
public function add ( $ prefix , $ dir , $ prepend = false ) { $ prefix = trim ( $ prefix , '\\' ) . '\\' ; $ dir = rtrim ( $ dir , DIRECTORY_SEPARATOR ) . '/' ; if ( isset ( $ this -> prefixes [ $ prefix ] ) === false ) { $ this -> prefixes [ $ prefix ] = [ ] ; } if ( $ prepend ) { array_unshift ( $ this -> prefixes [ $ prefix ] , $ dir ) ; } else { array_push ( $ this -> prefixes [ $ prefix ] , $ dir ) ; } return $ this ; }
Add a base directory for a given namespace prefix

@param string $prefix
@param string $dir
@param bool $prepend
@return self
Add a base directory for a given namespace prefix