Skip to content

Commit

Permalink
Merge pull request #10 from MARCspec/analysis-zEQjWD
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
cKlee authored Dec 1, 2017
2 parents c7f2fca + dc092bd commit 29abbff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
34 changes: 17 additions & 17 deletions src/File_MARC_Reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function interpreteSpec()
}
} // end foreach subfield spec
}
} else if ($this->spec->offsetExists('indicator')) {
} elseif ($this->spec->offsetExists('indicator')) {
if ($this->field instanceof File_MARC_Data_Field) {
/*
* Field SubSpec validation
Expand All @@ -144,7 +144,7 @@ private function interpreteSpec()
continue; // field subspec must be valid
}
}
$position = (int)$this->currentSpec['indicator']['position'];
$position = (int) $this->currentSpec['indicator']['position'];
$this->ref($this->currentSpec['indicator'], $this->field->getIndicator($position));
}
} else {
Expand All @@ -159,7 +159,7 @@ private function interpreteSpec()
continue; // field subspec must be valid
}
}

$this->ref($this->currentSpec['field'], $this->field);
}
$fieldIndex++;
Expand All @@ -168,28 +168,28 @@ private function interpreteSpec()
}

/**
* Get the current field index
*
* @param string $prevTag The previous field tag
* @param string $tag The current field tag
* @param int $fieldIndex The current field index
*
* @return int $fieldIndex The current field index
*/
* Get the current field index.
*
* @param string $prevTag The previous field tag
* @param string $tag The current field tag
* @param int $fieldIndex The current field index
*
* @return int $fieldIndex The current field index
*/
private function getFieldIndex($prevTag, $tag, $fieldIndex)
{
if($prevTag == $tag or '' == $prevTag) {
if ($prevTag == $tag or '' == $prevTag) {
return $fieldIndex; // iteration of field index will continue
}
$specTag = $this->currentSpec['field']->getTag();
if( preg_match('/'.$specTag.'/', $tag) ) {
if (preg_match('/'.$specTag.'/', $tag)) {
// not same field tag, but field spec tag matches
return $fieldIndex; # iteration of field index will continue
return $fieldIndex; // iteration of field index will continue
}
// not same field tag, iteration gets reset
return $this->spec['field']->getIndexStart();
}

/**
* Iterate on subspecs.
*
Expand Down Expand Up @@ -316,7 +316,7 @@ private function validateSubSpec()
break;

case '~':
if (0 < count(
if (0 < count(
array_uintersect(
$leftSubTerm,
$rightSubTerm,
Expand All @@ -335,7 +335,7 @@ function ($v1, $v2) {
break;

case '!~':
if (0 < count(
if (0 < count(
array_uintersect(
$leftSubTerm,
$rightSubTerm,
Expand Down
2 changes: 1 addition & 1 deletion test/ReferenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public function testWildCardFieldWithSubspec()
{
$Reference = new File_MARC_Reference('5..{$a~\piano}', $this->record);
$this->assertTrue(1 == count($Reference->content));

$Reference = new File_MARC_Reference('5..{$a~\Lewis}', $this->record);
$this->assertTrue(1 == count($Reference->content));
}
Expand Down

0 comments on commit 29abbff

Please sign in to comment.