<commit_before><?php

namespace Concise\Matcher;

class UrlHasPart extends AbstractMatcher
{
    public function supportedSyntaxes()
    {
        return array(
            'url ?:string has scheme ?:string' => 'URL has scheme.',
            'url ?:string has host ?:string' => 'URL has host.',
            'url ?:string has port ?:int' => 'URL has port.',
            'url ?:string has user ?:string' => 'URL has user.',
            'url ?:string has password ?:string' => 'URL has password.',
            'url ?:string has path ?:string' => 'URL has path.',
            'url ?:string has query ?:string' => 'URL has query.',
            'url ?:string has fragment ?:string' => 'URL has fragment.',
        );
    }

    public function match($syntax, array $data = array())
    {
        $parts = [
            'port' => PHP_URL_PORT,
            'host' => PHP_URL_HOST,
            'user' => PHP_URL_USER,
            'scheme' => PHP_URL_SCHEME,
            'password' => <PASSWORD>,
            'path' => PHP_URL_PATH,
            'query' => PHP_URL_QUERY,
            'fragment' => PHP_URL_FRAGMENT,
        ];
        $url = parse_url($data[0]);
        foreach ($parts as $kw => $part) {
            if (strpos($syntax, $kw)) {
                return parse_url($data[0], $part) == $data[1];
            }
        }
    }

    public function getTags()
    {
        return array(Tag::URLS);
    }<commit_msg>Fix code coverage<commit_after><?php

namespace Concise\Matcher;

class UrlHasPart extends AbstractMatcher
{
    public function supportedSyntaxes()
    {
        return array(
            'url ?:string has scheme ?:string' => 'URL has scheme.',
            'url ?:string has host ?:string' => 'URL has host.',
            'url ?:string has port ?:int' => 'URL has port.',
            'url ?:string has user ?:string' => 'URL has user.',
            'url ?:string has password ?:string' => 'URL has password.',
            'url ?:string has path ?:string' => 'URL has path.',
            'url ?:string has query ?:string' => 'URL has query.',
            'url ?:string has fragment ?:string' => 'URL has fragment.',
        );
    }

    public function match($syntax, array $data = array())
    {
        $parts = [
            'port' => PHP_URL_PORT,
            'host' => PHP_URL_HOST,
            'user' => PHP_URL_USER,
            'password' => <PASSWORD>,
            'path' => PHP_URL_PATH,
            'query' => PHP_URL_QUERY,
            'fragment' => PHP_URL_FRAGMENT,
        ];
        $url = parse_url($data[0]);
        foreach ($parts as $kw => $part) {
            if (strpos($syntax, $kw)) {
                return parse_url($data[0], $part) == $data[1];
            }
        }

        return parse_url($data[0], PHP_URL_SCHEME) == $data[1];
    }

    public function getTags()
    {
        return array(Tag::URLS);
    }
{'fraction_non_alphanumeric': 0.1535501923749563, 'fraction_numerical': 0.0027981811822315496, 'mean_word_length': 1.8714859437751004, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 38, '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': '4720026', 'n_tokens_mistral': 865, 'n_tokens_neox': 855, 'n_words': 240}