<commit_before><?php

class Host
{
    public static function domain()
    {
        return filter_var($_SERVER['HTTP_HOST'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
    }

    public static function protocol()
    {
        return sprintf('http%s://', ($_SERVER['HTTPS']) ? 's' : '');
    }

    public static function complete()
    {
        $request = explode('/', filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
        foreach ($request as $id => $fragment) {
            switch (true) {
                case empty($fragment):
                case strpos($fragment, '.php') !== false:
                    unset($request[$id]);
                    break;
                default:
            }
        }
        $request = implode('/', $request);

        return self::protocol().self::domain()."/$request";
    }
}<commit_msg>Cleanup Host<commit_after><?php

/**
 * Class Host
 */
class Host
{
    /**
     * @return string
     */
    public static function domain()
    {
        return filter_var($_SERVER['HTTP_HOST'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);
    }

    /**
     * @return string
     */
    public static function protocol()
    {
        return sprintf('http%s://', ($_SERVER['HTTPS']) ? 's' : '');
    }

    /**
     * @return string
     */
    public static function complete()
    {
        $request = explode('/',
            filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES));
        foreach ($request as $id => $fragment) {
            switch (true) {
                case empty($fragment):
                case strpos($fragment, '.php') !== false:
                    unset($request[$id]);
                    break;
                default:
            }
        }
        $request = implode('/', $request);

        return self::protocol().self::domain()."/$request";
    }
}
{'fraction_non_alphanumeric': 0.15085536547433903, 'fraction_numerical': 0.0, 'mean_word_length': 1.960122699386503, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3799072', 'n_tokens_mistral': 575, 'n_tokens_neox': 551, 'n_words': 107}