<commit_before><?php

namespace xsist10\HaveIBeenPwned\Adapter;

class FileGetContents implements Adapter
{
    public function get($url) {
        if (!ini_get('allow_url_fopen')) {
            throw new UnavailableException('allow_url_fopen disabled.');
        }

        $context = stream_context_create(array(
            'http' => array(
                'user_agent'          => 'xsist10-PHP-client'
            ),
            'ssl' => array(
                'method'              => 'GET',
                'verify_peer'         => true,
                'verify_depth'        => 5,
                'cafile'              => __DIR__ . '/../../cacert.pem',
                'CN_match'            => 'www.haveibeenpwned.com',
                'disable_compression' => true
            )
        ));
        
        $result = @file_get_contents($url, false, $context);
        if (empty($result))
        {
            $result = '[]';
        }

        return $result;
    }
}<commit_msg>Fixed bug in Exception type<commit_after><?php

namespace xsist10\HaveIBeenPwned\Adapter;

use \RuntimeException;

class FileGetContents implements Adapter
{
    public function get($url) {
        if (!ini_get('allow_url_fopen')) {
            throw new RuntimeException('allow_url_fopen disabled.');
        }

        $context = stream_context_create(array(
            'http' => array(
                'user_agent'          => 'xsist10-PHP-client'
            ),
            'ssl' => array(
                'method'              => 'GET',
                'verify_peer'         => true,
                'verify_depth'        => 5,
                'cafile'              => __DIR__ . '/../../cacert.pem',
                'CN_match'            => 'www.haveibeenpwned.com',
                'disable_compression' => true
            )
        ));
        
        $result = @file_get_contents($url, false, $context);
        if (empty($result))
        {
            $result = '[]';
        }

        return $result;
    }
}
{'fraction_non_alphanumeric': 0.13021868787276342, 'fraction_numerical': 0.004970178926441352, 'mean_word_length': 1.3488914819136524, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6864740', 'n_tokens_mistral': 585, 'n_tokens_neox': 569, 'n_words': 98}