original_string: private function iterateSubSpec($subSpecs, $fieldIndex, $subfieldIndex = null)
      {
          $valid = true;
          foreach ($subSpecs as $_subSpec) {
              if (is_array($_subSpec)) { // chained subSpecs (OR)
                  foreach ($_subSpec as $this->currentSubSpec) {
                      $this->setIndexStartEnd($fieldIndex, $subfieldIndex);
                      if ($valid = $this->checkSubSpec()) {
                          break; // at least one of them is true (OR)
                      }
                  }
              } else {
                  // repeated SubSpecs (AND)
                  $this->currentSubSpec = $_subSpec;
                  $this->setIndexStartEnd($fieldIndex, $subfieldIndex);
                  if (!$valid = $this->checkSubSpec()) {
                      break; // all of them have to be true (AND)
                  }
              }
          }
  
          return $valid;
      }
code: private function iterateSubSpec($subSpecs, $fieldIndex, $subfieldIndex = null)
      {
          $valid = true;
          foreach ($subSpecs as $_subSpec) {
              if (is_array($_subSpec)) { // chained subSpecs (OR)
                  foreach ($_subSpec as $this->currentSubSpec) {
                      $this->setIndexStartEnd($fieldIndex, $subfieldIndex);
                      if ($valid = $this->checkSubSpec()) {
                          break; // at least one of them is true (OR)
                      }
                  }
              } else {
                  // repeated SubSpecs (AND)
                  $this->currentSubSpec = $_subSpec;
                  $this->setIndexStartEnd($fieldIndex, $subfieldIndex);
                  if (!$valid = $this->checkSubSpec()) {
                      break; // all of them have to be true (AND)
                  }
              }
          }
  
          return $valid;
      }
code_tokens: private function iterateSubSpec ( $ subSpecs , $ fieldIndex , $ subfieldIndex = null ) { $ valid = true ; foreach ( $ subSpecs as $ _subSpec ) { if ( is_array ( $ _subSpec ) ) { // chained subSpecs (OR) foreach ( $ _subSpec as $ this -> currentSubSpec ) { $ this -> setIndexStartEnd ( $ fieldIndex , $ subfieldIndex ) ; if ( $ valid = $ this -> checkSubSpec ( ) ) { break ; // at least one of them is true (OR) } } } else { // repeated SubSpecs (AND) $ this -> currentSubSpec = $ _subSpec ; $ this -> setIndexStartEnd ( $ fieldIndex , $ subfieldIndex ) ; if ( ! $ valid = $ this -> checkSubSpec ( ) ) { break ; // all of them have to be true (AND) } } } return $ valid ; }
docstring: Iterate on subspecs.
  
  @param array $subSpecs      Array of subspecs
  @param int   $fieldIndex    The current field index
  @param int   $subfieldIndex The current subfield index
  
  @return bool The validation result
docstring_tokens: Iterate on subspecs .