public function addToSearchPath(string $name, string $path, int $precedence)
    {
        if (!is_dir($path))
            throw new \InvalidArgumentException("Path does not exist: " . $path);

        $this->search_path[$name] = array('path' => $path, 'precedence' => $precedence);
        $this->sorted = false;
        
        return $this;
    }