think\console\input\Argument::__construct PHP Метод

__construct() публичный Метод

构造方法
public __construct ( string $name, integer $mode = null, string $description = '', mixed $default = null )
$name string 参数名
$mode integer 参数类型: self::REQUIRED 或者 self::OPTIONAL
$description string 描述
$default mixed 默认值 (仅 self::OPTIONAL 类型有效)
    public function __construct($name, $mode = null, $description = '', $default = null)
    {
        if (null === $mode) {
            $mode = self::OPTIONAL;
        } elseif (!is_int($mode) || $mode > 7 || $mode < 1) {
            throw new \InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode));
        }
        $this->name = $name;
        $this->mode = $mode;
        $this->description = $description;
        $this->setDefault($default);
    }