original_string: protected function validateValueRating()
      {
          $field = 'rating';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
          $label = $this->translation->text('Rating');
  
          if (!isset($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          if ($value > 5) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          return true;
      }
code: protected function validateValueRating()
      {
          $field = 'rating';
  
          if ($this->isExcluded($field)) {
              return null;
          }
  
          $value = $this->getSubmitted($field);
          $label = $this->translation->text('Rating');
  
          if (!isset($value)) {
              $this->setErrorRequired($field, $label);
              return false;
          }
  
          if (!is_numeric($value)) {
              $this->setErrorNumeric($field, $label);
              return false;
          }
  
          if ($value > 5) {
              $this->setErrorInvalid($field, $label);
              return false;
          }
  
          return true;
      }
code_tokens: protected function validateValueRating ( ) { $ field = 'rating' ; if ( $ this -> isExcluded ( $ field ) ) { return null ; } $ value = $ this -> getSubmitted ( $ field ) ; $ label = $ this -> translation -> text ( 'Rating' ) ; if ( ! isset ( $ value ) ) { $ this -> setErrorRequired ( $ field , $ label ) ; return false ; } if ( ! is_numeric ( $ value ) ) { $ this -> setErrorNumeric ( $ field , $ label ) ; return false ; } if ( $ value > 5 ) { $ this -> setErrorInvalid ( $ field , $ label ) ; return false ; } return true ; }
docstring: Validates a rating value
  @return boolean
docstring_tokens: Validates a rating value