<commit_before><?php
namespace Ely\TempMailBuster\Loader;

use Ely\TempMailBuster\LoaderInterface;
use Exception;

/**
 * Class-wrapper for https://github.com/elyby/anti-tempmail-repo data file
 */
class AntiTempmailRepo implements LoaderInterface
{
    /**
     * @var array with custom paths to find data file
     */
    private $customPaths;

    /**
     * @param array $customPaths
     */
    public function __construct(array $customPaths = [])
    {
        $this->customPaths = $customPaths;
    }

    /**
     * @inheritdoc
     */
    public function load()
    {
        $paths = $this->getPaths();
        $dataPath = null;
        foreach($paths as $path) {
            if (file_exists($path)) {
                $dataPath = $path;
                break;
            }
        }

        if ($dataPath === null) {
            throw new Exception('Cannot find data file. Please check getPaths() implementation.');
        }

        $data = json_decode(file_get_contents($dataPath), true);
        if (!is_array($data)) {
            throw new Exception('Cannot decode json from data file.');
        }

        return $data;
    }

    /**
     * Generates file path array to data repository.
     *
     * Default paths are used in following cases:
     * 1. if this library and data repository are included in project as composer dependencies;
     * 2. if this library is deployed for development (data repository included as composer dependency to this library).
     *
     * @see Loader::customPath for custom data repository implementation
     *
     * @return array
     */
    protected function getPaths()
    {
        return array_merge($this->customPaths, [
            __DIR__ . '/../../../anti-tempmail-repo/data.json',
            __DIR__ . '/../../vendor/ely/anti-tempmail-repo/data.json',
        ]);
    }
}<commit_msg>Another comment fix<commit_after><?php
namespace Ely\TempMailBuster\Loader;

use Ely\TempMailBuster\LoaderInterface;
use Exception;

/**
 * Class-wrapper for https://github.com/elyby/anti-tempmail-repo data file
 */
class AntiTempmailRepo implements LoaderInterface
{
    /**
     * @var array with custom paths to find data file
     */
    private $customPaths;

    /**
     * @param array $customPaths
     */
    public function __construct(array $customPaths = [])
    {
        $this->customPaths = $customPaths;
    }

    /**
     * @inheritdoc
     */
    public function load()
    {
        $paths = $this->getPaths();
        $dataPath = null;
        foreach($paths as $path) {
            if (file_exists($path)) {
                $dataPath = $path;
                break;
            }
        }

        if ($dataPath === null) {
            throw new Exception('Cannot find data file. Please check getPaths() implementation.');
        }

        $data = json_decode(file_get_contents($dataPath), true);
        if (!is_array($data)) {
            throw new Exception('Cannot decode json from data file.');
        }

        return $data;
    }

    /**
     * Generates file path array to data repository.
     *
     * Default paths are used in following cases:
     * 1. if this library and data repository are included in project as composer dependencies;
     * 2. if this library is deployed for development (data repository included as composer dependency to this library).
     *
     * @return array
     */
    protected function getPaths()
    {
        return array_merge($this->customPaths, [
            __DIR__ . '/../../../anti-tempmail-repo/data.json',
            __DIR__ . '/../../vendor/ely/anti-tempmail-repo/data.json',
        ]);
    }
}
{'fraction_non_alphanumeric': 0.11750137589433131, 'fraction_numerical': 0.001100715465052284, 'mean_word_length': 2.029166666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '6251811', 'n_tokens_mistral': 1004, 'n_tokens_neox': 987, 'n_words': 281}