think\console\output\Ask::validateAttempts PHP Метод

validateAttempts() защищенный Метод

protected validateAttempts ( $interviewer )
    protected function validateAttempts($interviewer)
    {
        /** @var \Exception $error */
        $error = null;
        $attempts = $this->question->getMaxAttempts();
        while (null === $attempts || $attempts--) {
            if (null !== $error) {
                $this->output->error($error->getMessage());
            }
            try {
                return call_user_func($this->question->getValidator(), $interviewer());
            } catch (\Exception $error) {
            }
        }
        throw $error;
    }