<commit_before><?php
namespace Phlite;

require_once 'PhliteException.php';

class UserException extends PhliteException {
    public const CODE_PREFIX = 100;
    public const CODE = [
        'USER_NOT_FOUND'       => 1,
        'USERNAME_INVALID'     => 2,
        'USERNAME_UNAVAILABLE' => 3,
        'EMAIL_INVALID'        => 4,
        'EMAIL_UNAVAILABLE'    => 5,
        'PASSWORD_INVALID'     => 6,
    ];

    public function __construct(int $code) {
        parent::__construct(null, $code + self::CODE_PREFIX);
    }
}

?><commit_msg>Added code/message lookup array constant to UserException<commit_after><?php
namespace Phlite;

require_once 'PhliteException.php';

class UserException extends PhliteException {
    public const CODE_PREFIX = 100;
    public const CODE = [
        'USER_NOT_FOUND'       => 1,
        'USERNAME_INVALID'     => 2,
        'USERNAME_UNAVAILABLE' => 3,
        'EMAIL_INVALID'        => 4,
        'EMAIL_UNAVAILABLE'    => 5,
        'PASSWORD_INVALID'     => 6,
    ];
    protected const MESSAGE = [
        self::CODE['USER_NOT_FOUND']       => 'User not found',
        self::CODE['USERNAME_INVALID']     => 'Invalid username',
        self::CODE['USERNAME_UNAVAILABLE'] => 'Unavailable username',
        self::CODE['EMAIL_INVALID']        => 'Invalid email address',
        self::CODE['EMAIL_UNAVAILABLE']    => 'Unavailable email address',
        self::CODE['PASSWORD_INVALID']     => 'Invalid password',
    ];

    public function __construct(int $code) {
        parent::__construct(null, $code + self::CODE_PREFIX);
    }
}

?>
{'fraction_non_alphanumeric': 0.12681388012618297, 'fraction_numerical': 0.011356466876971609, 'mean_word_length': 2.679814385150812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '2923177', 'n_tokens_mistral': 512, 'n_tokens_neox': 489, 'n_words': 100}