public function registerModule(string $module, string $path, int $precedence)
    {
        // Normalize the module name: lowercased, with dots
        $module = strtolower(preg_replace('/([\.\\/\\\\])/', '.', $module));

        $found_elements = array();
        foreach ($this->resolvers as $type => $resolver)
        {
            $type_path = $path . DIRECTORY_SEPARATOR . $resolver['path'];
            if (is_dir($type_path))
            {
                $resolver['resolver']->addToSearchPath($module, $type_path, $precedence);
                $found_elements[] = $type;
            }
        }

        if (!empty($found_elements))
            $this->modules[$module] = ['path' => $path, 'precedence' => $precedence];
        else
            self::getLogger()->debug("No resolvable items found in module: " . $module);

        // No longer sorted, probably
        $this->sorted = false;

        return $this;
    }