๐Ÿ”“ Ultimate Webshell - Penetration Testing Tool

๐Ÿ“– File Reader

<?php
/**
 * PHP่กจๅ•็”Ÿๆˆๅ™จ
 *
 * @package  FormBuilder
 * @author   xaboy <xaboy2005@qq.com>
 * @version  2.0
 * @license  MIT
 * @link     https://github.com/xaboy/form-builder
 * @document http://php.form-create.com
 */

namespace FormBuilder\Annotation\Validate;


/**
 * @Annotation
 */
final class Enum extends ValidateAnnotation
{
    /**
     * @Required
     * @var array
     */
    public $value = [];


    public function parseRule($rule)
    {
        $rule = $this->tidyValidate($rule);
        $rule['validate'][] = ['enum' => $this->value, 'type' => $this->type, 'trigger' => $this->trigger, 'message' => $this->message];
        return $rule;
    }

    public function parseComponent($component)
    {
        $component->appendValidate($component->createValidate()->enum($this->value)->message($this->message));
        return $component;
    }
}