<commit_before><?php
namespace Tuum\Router\Tuum;

use Psr\Http\Message\RequestInterface;
use Tuum\Router\Route;
use Tuum\Router\ReverseRouteInterface;
use Tuum\Router\RouterInterface;
use Tuum\Routing\Router as BaseRouter;

class Router implements RouterInterface
{
    /**
     * @var BaseRouter
     */
    protected $router;

    /**
     * @param BaseRouter $router
     */
    protected function __construct($router)
    {
        $this->router = $router;
    }

    /**
     * @return Router
     */
    public static function forge()
    {
        return new self(new BaseRouter());
    }

    /**
     * matches against $request.
     * returns matched result, or false if not matched.
     *
     * @param RequestInterface $request
     * @return mixed|Route
     */
    public function match($request)
    {
        $path   = $request->getUri()->getPath();
        $method = $request->getMethod();
        $found  = $this->router->match($path, $method);
        if (!$found) {
            return null;
        }
        return new Route($found[0]->data);
    }

    /**
     * get router to set routes.
     * returns various router object.
     *
     * @return mixed
     */
    public function getRouting()
    {
        return $this->router->getRouting();
    }

    /**
     * @return ReverseRouteInterface
     */
    public function getReverseRoute()
    {
        return new NamedRoute($this->router->getReverseRoute());
    }
}<commit_msg>specify the returned object class.<commit_after><?php
namespace Tuum\Router\Tuum;

use Psr\Http\Message\RequestInterface;
use Tuum\Router\Route;
use Tuum\Router\ReverseRouteInterface;
use Tuum\Router\RouterInterface;
use Tuum\Routing\RouteCollector;
use Tuum\Routing\Router as BaseRouter;

class Router implements RouterInterface
{
    /**
     * @var BaseRouter
     */
    protected $router;

    /**
     * @param BaseRouter $router
     */
    protected function __construct($router)
    {
        $this->router = $router;
    }

    /**
     * @return Router
     */
    public static function forge()
    {
        return new self(new BaseRouter());
    }

    /**
     * matches against $request.
     * returns matched result, or false if not matched.
     *
     * @param RequestInterface $request
     * @return mixed|Route
     */
    public function match($request)
    {
        $path   = $request->getUri()->getPath();
        $method = $request->getMethod();
        $found  = $this->router->match($path, $method);
        if (!$found) {
            return null;
        }
        return new Route($found[0]->data);
    }

    /**
     * get router to set routes.
     * returns various router object.
     *
     * @return RouteCollector
     */
    public function getRouting()
    {
        return $this->router->getRouting();
    }

    /**
     * @return ReverseRouteInterface
     */
    public function getReverseRoute()
    {
        return new NamedRoute($this->router->getReverseRoute());
    }
}
{'fraction_non_alphanumeric': 0.12621685129238, 'fraction_numerical': 0.000671366230278617, 'mean_word_length': 2.1702127659574466, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '5749790', 'n_tokens_mistral': 873, 'n_tokens_neox': 864, 'n_words': 202}