public function setPrecedence(string $name, int $precedence)
    {
        if (!isset($this->search_path[$name]))
            throw new \InvalidArgumentException("Unknown module: " . $name);

        if ($this->search_path[$name]['precedence'] !== $precedence)
        {
            $this->search_path[$name]['precedence'] = $precedence;
            $this->sorted = false;
        }
        return $this;
    }