think\console\output\Question::setMaxAttempts PHP Method

setMaxAttempts() public method

设置最大重试次数
public setMaxAttempts ( null | integer $attempts ) : Question
$attempts null | integer
return Question
    public function setMaxAttempts($attempts)
    {
        if (null !== $attempts && $attempts < 1) {
            throw new \InvalidArgumentException('Maximum number of attempts must be a positive value.');
        }
        $this->attempts = $attempts;
        return $this;
    }