<commit_before><?php
/**
 * Copyright (C) 2014 <NAME>
 * 
 * Defines the routing bootstrapper
 */
namespace Project\Routing\Bootstrappers;
use RDev\Applications\Bootstrappers;
use RDev\IoC;
use RDev\Routing;
use RDev\Routing\Compilers;

class Router implements Bootstrappers\IBootstrapper
{
    /** @var IoC\IContainer The dependency injection container to use */
    private $container = null;

    /**
     * @param IoC\IContainer $container The dependency injection container to use
     */
    public function __construct(IoC\IContainer $container)
    {
        $this->container = $container;
    }

    /**
     * {@inheritdoc}
     */
    public function run()
    {
        $dispatcher = new Routing\Dispatcher($this->container);
        $compiler = new Compilers\Compiler();
        $router = new Routing\Router(
            $dispatcher,
            $compiler,
            "Project\\Routing\\Controllers\\Example"
        );
        $this->container->bind("RDev\\Routing\\Router", $router);
    }
}<commit_msg>Updated to latest RDev, added support for namedRouteURL() in templates<commit_after><?php
/**
 * Copyright (C) 2014 <NAME>
 * 
 * Defines the routing bootstrapper
 */
namespace Project\Routing\Bootstrappers;
use RDev\Applications\Bootstrappers;
use RDev\IoC;
use RDev\Routing;
use RDev\Routing\Compilers as RoutingCompilers;
use RDev\Routing\URL;
use RDev\Views\Compilers as ViewCompilers;

class Router implements Bootstrappers\IBootstrapper
{
    /** @var IoC\IContainer The dependency injection container to use */
    private $container = null;
    /** @var ViewCompilers\ICompiler The view compiler used by this application */
    private $viewCompiler = null;
    /** @var URL\URLGenerator The URL generator used by this application */
    private $urlGenerator = null;

    /**
     * @param IoC\IContainer $container The dependency injection container to use
     * @param ViewCompilers\ICompiler $viewCompiler The view compiler used by this application
     * @param URL\URLGenerator $urlGenerator The URL generator used by this application
     */
    public function __construct(
        IoC\IContainer $container,
        ViewCompilers\ICompiler $viewCompiler,
        URL\URLGenerator $urlGenerator
    )
    {
        $this->container = $container;
        $this->viewCompiler = $viewCompiler;
        $this->urlGenerator = $urlGenerator;
    }

    /**
     * {@inheritdoc}
     */
    public function run()
    {
        $dispatcher = new Routing\Dispatcher($this->container);
        $compiler = new RoutingCompilers\Compiler();
        $router = new Routing\Router(
            $dispatcher,
            $compiler,
            "Project\\Routing\\Controllers\\Example"
        );
        $this->container->bind("RDev\\Routing\\Router", $router);
        $this->viewCompiler->registerTemplateFunction("namedRouteURL", function($routeName, $arguments = [])
        {
            return $this->urlGenerator->createFromName($routeName, $arguments);
        });
    }
}
{'fraction_non_alphanumeric': 0.1130376792264088, 'fraction_numerical': 0.00266755585195065, 'mean_word_length': 2.8560411311053984, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '3390437', 'n_tokens_mistral': 832, 'n_tokens_neox': 834, 'n_words': 210}