original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Sets the maximum number of attempts.
  
  Null means an unlimited number of attempts.
  
  @param int|null $attempts
  
  @return $this
  
  @throws InvalidArgumentException in case the number of attempts is invalid
docstring_tokens: Sets the maximum number of attempts .