<commit_before><?php
/**
 * @author        "<NAME>" <<EMAIL>>
 * @package       Metrol/Route
 * @version       1.0
 * @copyright (c) 2022, <NAME>
 */

namespace Metrol\Route;

use Metrol;

/**
 * Defines a request that can be compared against a route
 *
 */
class Request
{
    const DEFAULT_URI = '/';
    const DEFAULT_HTTP_METHOD = Metrol\Route::HTTP_GET;

    /**
     * The URI being passed in as part of the request
     *
     */
    protected string $uri;

    /**
     * The HTTP method being requested
     *
     */
    protected string $httpMethod;

    /**
     * Initializes the Route Request Definition
     *
     */
    public function __construct()
    {
        if ( isset($_SERVER['REQUEST_URI']) )
        {
            $this->setUri($_SERVER['REQUEST_URI']);
        }
        else
        {
            $this->uri = self::DEFAULT_URI;
        }

        if ( isset($_SERVER['REQUEST_METHOD']) )
        {
            $this->setHttpMethod($_SERVER['REQUEST_METHOD']);
        }
        else
        {
            $this->httpMethod = self::DEFAULT_HTTP_METHOD;
        }
    }

    /**
     * Used to set the information in this object based on a Metrol\Request
     * object.
     *
     */
    public function setRequest(Metrol\Request $request): static
    {
        $this->setUri($request->server()->uri);
        $this->setHttpMethod($request->server()->method);<commit_msg>Set default property values at the declaration<commit_after><?php
/**
 * @author        "<NAME>" <<EMAIL>>
 * @package       Metrol/Route
 * @version       1.0
 * @copyright (c) 2022, <NAME>
 */

namespace Metrol\Route;

use Metrol;

/**
 * Defines a request that can be compared against a route
 *
 */
class Request
{
    const DEFAULT_URI = '/';
    const DEFAULT_HTTP_METHOD = Metrol\Route::HTTP_GET;

    /**
     * The URI being passed in as part of the request
     *
     */
    protected string $uri = self::DEFAULT_URI;

    /**
     * The HTTP method being requested
     *
     */
    protected string $httpMethod = self::DEFAULT_HTTP_METHOD;

    /**
     * Initializes the Route Request Definition
     *
     */
    public function __construct()
    {
        if ( isset($_SERVER['REQUEST_URI']) )
        {
            $this->setUri($_SERVER['REQUEST_URI']);
        }

        if ( isset($_SERVER['REQUEST_METHOD']) )
        {
            $this->setHttpMethod($_SERVER['REQUEST_METHOD']);
        }
    }

    /**
     * Used to set the information in this object based on a Metrol\Request
     * object.
     *
     */
    public function setRequest(Metrol\Request $request): static
    {
        $this->setUri($request->server()->uri);
        $this->setHttpMethod($request->server()->method);
{'fraction_non_alphanumeric': 0.13348082595870206, 'fraction_numerical': 0.004424778761061947, 'mean_word_length': 2.0448933782267114, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 29, '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': '4081594', 'n_tokens_mistral': 788, 'n_tokens_neox': 779, 'n_words': 189}