getValidator() public méthode

获取验证器
public getValidator ( ) : null | callable
Résultat null | callable
Exemple #1
0
 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;
 }