<commit_before><?php namespace Zephyrus\Utilities\Validations;

class BaseValidation
{
    public static function isNotEmpty($data): bool
    {
        return !empty(trim($data));
    }

    public static function isAlpha($data): bool
    {
        $accentedChar = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ";
        return self::isRegexValid($data, "[a-zA-Z" . $accentedChar . "]+");
    }

    public static function isName($data): bool
    {
        $accentedChar = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ";
        return self::isRegexValid($data, "[a-zA-Z- " . $accentedChar . "]+");
    }

    public static function isAlphanumeric($data): bool
    {
        return preg_match('/^[a-zA-Z0-9]+$/', $data);
    }
<commit_msg>Allowed to validate empty array<commit_after><?php namespace Zephyrus\Utilities\Validations;

class BaseValidation
{
    public static function isNotEmpty($data): bool
    {
        return !empty(is_string($data) ? trim($data) : $data);
    }

    public static function isAlpha($data): bool
    {
        $accentedChar = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ";
        return self::isRegexValid($data, "[a-zA-Z" . $accentedChar . "]+");
    }

    public static function isName($data): bool
    {
        $accentedChar = "àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ";
        return self::isRegexValid($data, "[a-zA-Z- " . $accentedChar . "]+");
    }

    public static function isAlphanumeric($data): bool
    {
        return preg_match('/^[a-zA-Z0-9]+$/', $data);
    }

{'fraction_non_alphanumeric': 0.13736609955891618, 'fraction_numerical': 0.002520478890989288, 'mean_word_length': 3.398891966759003, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '131906', 'n_tokens_mistral': 688, 'n_tokens_neox': 744, 'n_words': 90}