<?php

namespace Application\Validator\Config;

use Laminas\Validator\Identical;
use Laminas\Validator\NotEmpty;
use Laminas\Validator\Regex;
use Laminas\Validator\StringLength;

class Map
{
    public CONST VALIDATOR_QEQUIRED  = 'required';  // 必填
    public CONST VALIDATOR_MIN       = 'min';
    public CONST VALIDATOR_MAX       = 'max';
    public CONST VALIDATOR_IDENTICAL = 'identical'; // 两个值相等
    public CONST VALIDATOR_USERPASSWORDRULES = 'userPasswordRules'; // 两个值相等

    public CONST VALIDATOR_CLASS_MAP = [
        self::VALIDATOR_QEQUIRED          => NotEmpty::class,
        self::VALIDATOR_MIN               => StringLength::class,
        self::VALIDATOR_MAX               => StringLength::class,
        self::VALIDATOR_IDENTICAL         => Identical::class,
        self::VALIDATOR_USERPASSWORDRULES => Regex::class,
    ];

    public const VALIDATOR_MESSAGE_KEY_MAP = [
        self::VALIDATOR_MIN       => StringLength::TOO_SHORT,
        self::VALIDATOR_MAX       => StringLength::TOO_LONG,
    ];
}