<commit_before><?php

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

namespace Valkyrja\Contracts\Routing;

use Valkyrja\Contracts\Application;
use Valkyrja\Contracts\Http\Request;
use Valkyrja\Contracts\Http\Response;
use Valkyrja\Http\RequestMethod;
use Valkyrja\Routing\Route;

/**
 * Interface Router
 *
 * @package Valkyrja\Contracts\Http
 *
 * @author  <NAME>
 */
interface Router
{
    /**
     * The variable regex.
     *
     * @constant string
     */
    public const VARIABLE_REGEX = <<<'REGEX'
\{
    \s* ([a-zA-Z_][a-zA-Z0-9_-]*) \s*
    (?:
        : \s* 
        (
            [
                ^{}]*
                (?:
                    \{(?-1
                )
                \}[^{}
            ]*)
        *)
    )?
\}
REGEX;

    /**
     * Router constructor.
     *
     * @param \Valkyrja\Contracts\Application $application
     */
    public function __construct(Application $application);

    /**
     * Set a single route.
     *
     * @param \Valkyrja\Routing\Route $route
     *
     * @return void
     */
    public function addRoute(Route $route): void;

    /**
     * Helper function to set a GET addRoute.
     *
     * @param \Valkyrja\Routing\Route $route The route
     *
     * @return void
     */
    public function get(Route $route): void;
<commit_msg>Reformatting variable regex to be more readable.<commit_after><?php

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

namespace Valkyrja\Contracts\Routing;

use Valkyrja\Contracts\Application;
use Valkyrja\Contracts\Http\Request;
use Valkyrja\Contracts\Http\Response;
use Valkyrja\Http\RequestMethod;
use Valkyrja\Routing\Route;

/**
 * Interface Router
 *
 * @package Valkyrja\Contracts\Http
 *
 * @author  <NAME>
 */
interface Router
{
    /**
     * The variable regex.
     *
     * @constant string
     */
    public const VARIABLE_REGEX = <<<'REGEX'
\{
    \s* ([a-zA-Z_][a-zA-Z0-9_-]*) \s*
    (?:
        : \s* 
        (
            [
                ^{}]*
                (?:
                \{(?-1)\}
                [^{}
            ]*)
        *)
    )?
\}
REGEX;

    /**
     * Router constructor.
     *
     * @param \Valkyrja\Contracts\Application $application
     */
    public function __construct(Application $application);

    /**
     * Set a single route.
     *
     * @param \Valkyrja\Routing\Route $route
     *
     * @return void
     */
    public function addRoute(Route $route): void;

    /**
     * Helper function to set a GET addRoute.
     *
     * @param \Valkyrja\Routing\Route $route The route
     *
     * @return void
     */
    public function get(Route $route): void;

{'fraction_non_alphanumeric': 0.1328551912568306, 'fraction_numerical': 0.0020491803278688526, 'mean_word_length': 1.8743866535819431, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, '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': '1198369', 'n_tokens_mistral': 971, 'n_tokens_neox': 948, 'n_words': 220}