src/Resolver.php
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;
    }
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;
    }
Register a module

@param string $module The name of the module
@param string $path The path where the module stores its data
@param int $precedence Determines the order in which the paths are
searched. Used for templates and assets, to
make it possible to reliably override others.
@return Resolver Provides fluent interface