<commit_before><?php

use Phalcon\Mvc\Router;

$di->set('router', function () use ($modules, $defaultModule) {

    $router = new Router(false);

    /**
     * Remove Extra Slashes
     * http://docs.phalconphp.com/en/latest/reference/routing.html#dealing-with-extra-trailing-slashes
     */
    $router->removeExtraSlashes(true);

    /**
     * Setting Default Paths
     * http://docs.phalconphp.com/en/latest/reference/routing.html#setting-default-paths
     */
    if (!empty($defaultModule)) {
        $router->setDefaultModule($defaultModule);
    }

    /**
     * Set Default Route
     * http://docs.phalconphp.com/en/latest/reference/routing.html#setting-the-default-route
     */
    $router->add('/', array(
        'controller' => 'index',
        'action' => 'index'
    ));

    /**
     * Set Not Found Page
     * http://docs.phalconphp.com/en/latest/reference/routing.html#not-found-paths
     * See [app.config.dispatcher.php]
     */
    // $router->notFound(array(
    //     'controller' => 'error',
    //     'action' => 'e404'
    // ));

    /**
     * Generic Modules Route
     * http://docs.phalconphp.com/en/latest/reference/routing.html#routing-to-modules
     */
    $router->add('/:module/:controller/:action/:params', array(
        'module' => 1,
        'controller' => 2,
        'action' => 3,
        'params' => 4
    ));

    return $router;
});
<commit_msg>New routes and error message to access only the module name<commit_after><?php

use Phalcon\Mvc\Router;

$di->set('router', function () use ($modules, $defaultModule) {

    $router = new Router(false);

    /**
     * Remove Extra Slashes
     * http://docs.phalconphp.com/en/latest/reference/routing.html#dealing-with-extra-trailing-slashes
     */
    $router->removeExtraSlashes(true);

    /**
     * Setting Default Paths
     * http://docs.phalconphp.com/en/latest/reference/routing.html#setting-default-paths
     */
    if (!empty($defaultModule)) {
        $router->setDefaultModule($defaultModule);
    }

    /**
     * Set Default Route
     * http://docs.phalconphp.com/en/latest/reference/routing.html#setting-the-default-route
     */
    $router->add('/', array(
        'controller' => 'index',
        'action' => 'index'
    ));

    /**
     * Set Not Found Page
     * http://docs.phalconphp.com/en/latest/reference/routing.html#not-found-paths
     * See [app.config.dispatcher.php]
     */
    // $router->notFound(array(
    //     'controller' => 'error',
    //     'action' => 'e404'
    // ));

    /**
     * Generic Modules Route
     * http://docs.phalconphp.com/en/latest/reference/routing.html#routing-to-modules
     */
    $router->add('/:module/:controller/:action/:params', array(
        'module' => 1,
        'controller' => 2,
        'action' => 3,
        'params' => 4
    ));

    $router->add('/:module/:controller/:action[/]?', array(
        'module' => 1,
        'controller' => 2,
        'action' => 3
    ));

    $router->add('/:module/:controller[/]?', array(
        'module' => 1,
        'controller' => 2,
        'action' => 'index'
    ));

    $router->add('/:module[/]?', array(
        'controller' => 'error',
        'action' => 'e404'
    ));

    return $router;
});

{'fraction_non_alphanumeric': 0.18844609206054988, 'fraction_numerical': 0.006796416434970652, 'mean_word_length': 2.2806484295845997, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1265896', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1060, 'n_words': 154}