src/File_MARC_Reference.php
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;
    }
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;
    }
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 ; }
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
Iterate on subspecs .