<commit_before><?php

namespace Prosper\Core\Http;

/**
 * This file is part of the Prosper/Core package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Prosper\Core\Database\Models\Website;
use Prosper\Core\Context;

/**
 * Class Router
 * @package Prosper\Core\Http\Router
 */
class Router
{

    /**
     * @var null|\Prosper\Core\Database\Models\Website
     */
    protected $website = null;

    /**
     * @var null|\Prosper\Core\Database\Models\Language
     */
    protected $language = null;

    /**
     * @var null|\Prosper\Core\Database\Models\Page
     */
    protected $page = null;

    /**
     * Router constructor.
     */
    public function __construct()
    {
        // Only do the discovery of websites, languages
        // and pages whilst on the frontend context.
        if (app('prosper.context') == Context::FRONTEND && !app()->runningInConsole()) {
            try {
                $this
                    ->discoverWebsite()
                    ->discoverLanguage()
                    ->discoverPage();
            } catch (\Exception $e) {
                abort(404);
            }
        }
    }

    /**
     * Append new routes to the framework.
     * These can either come from a file or a closure.
     *
     * @param  string|callable  $routes
     * @param  array            $arguments
     *
     * @return $this
     */
    public function register($routes, array $arguments = [])
    {
        $defaults = [
            'with-prefix' => true,
            'guarded'     => true
        ];<commit_msg>aborting removed (I know, I know)<commit_after><?php

namespace Prosper\Core\Http;

/**
 * This file is part of the Prosper/Core package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

use Prosper\Core\Database\Models\Website;
use Prosper\Core\Context;

/**
 * Class Router
 * @package Prosper\Core\Http\Router
 */
class Router
{

    /**
     * @var null|\Prosper\Core\Database\Models\Website
     */
    protected $website = null;

    /**
     * @var null|\Prosper\Core\Database\Models\Language
     */
    protected $language = null;

    /**
     * @var null|\Prosper\Core\Database\Models\Page
     */
    protected $page = null;

    /**
     * Router constructor.
     */
    public function __construct()
    {
        // Only do the discovery of websites, languages
        // and pages whilst on the frontend context.
        if (app('prosper.context') == Context::FRONTEND && !app()->runningInConsole()) {
            try {
                $this
                    ->discoverWebsite()
                    ->discoverLanguage()
                    ->discoverPage();
            } catch (\Exception $e) {
                // Try it all, catch nothing...
                // (I know, I know)
            }
        }
    }

    /**
     * Append new routes to the framework.
     * These can either come from a file or a closure.
     *
     * @param  string|callable  $routes
     * @param  array            $arguments
     *
     * @return $this
     */
    public function register($routes, array $arguments = [])
    {
        $defaults = [
            'with-prefix' => true,
            'guarded'     => true
        ];
{'fraction_non_alphanumeric': 0.12514654161781946, 'fraction_numerical': 0.0008792497069167644, 'mean_word_length': 1.7238627294493216, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 21, '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': '2741603', 'n_tokens_mistral': 993, 'n_tokens_neox': 953, 'n_words': 261}