<commit_before><?php 

namespace Core;

use \Core\Route;
use \Core\App;
use \Libs\Collection;

class Router 
{

    /**
     * List of routes
     * @var array
     */
    protected $routes = array();

    /**
     * List of named routes
     * @var array
     */
    protected $namedRoutes = array();

    protected $verbs = array('GET', 'POST', 'PUT', 'PATCH', 'DELETE');

    /**
     * Register a new route
     * @param  string $method Name of the HTTP method
     * @param  array $args    List of the arguments for the route
     */
    public function __call($method, $args)
    {
        $method = strtoupper($method);
        if(in_array($method, $this->verbs))
        {
            $route = new Route($args[0], $args[1]);
            $this->routes[$method][] = $route;
            if(isset($args[2]))
            {
                $this->namedRoutes[$args[2]] = $route;
            }
            return $route;
        }
    }

    /**
     * Register RESTful route associated to a resource
     * @param  string $name       Name of the resource
     * @param  string $controller Controller associated to the resource<commit_msg>Doc var verbs<commit_after><?php 

namespace Core;

use \Core\Route;
use \Core\App;
use \Libs\Collection;

class Router 
{

    /**
     * List of routes
     * @var array
     */
    protected $routes = array();

    /**
     * List of named routes
     * @var array
     */
    protected $namedRoutes = array();

    /**
     * List of HTTP verbs
     * @var array
     */
    protected $verbs = array('GET', 'POST', 'PUT', 'PATCH', 'DELETE');

    /**
     * Register a new route
     * @param  string $method Name of the HTTP method
     * @param  array $args    List of the arguments for the route
     */
    public function __call($method, $args)
    {
        $method = strtoupper($method);
        if(in_array($method, $this->verbs))
        {
            $route = new Route($args[0], $args[1]);
            $this->routes[$method][] = $route;
            if(isset($args[2]))
            {
                $this->namedRoutes[$args[2]] = $route;
            }
            return $route;
        }
    }

    /**
     * Register RESTful route associated to a resource
     * @param  string $name       Name of the resource
     * @param  string $controller Controller associated to the resource
{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.003418803418803419, 'mean_word_length': 1.8618581907090463, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1495156', 'n_tokens_mistral': 704, 'n_tokens_neox': 691, 'n_words': 203}