From dc092bdac940a7d82a680f5e87a9078f9c7b1deb Mon Sep 17 00:00:00 2001 From: Carsten Klee Date: Fri, 1 Dec 2017 09:13:03 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/File_MARC_Reference.php | 34 +++++++++++++++++----------------- test/ReferenceTest.php | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/File_MARC_Reference.php b/src/File_MARC_Reference.php index 48c42ef..625fe2d 100755 --- a/src/File_MARC_Reference.php +++ b/src/File_MARC_Reference.php @@ -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 @@ -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 { @@ -159,7 +159,7 @@ private function interpreteSpec() continue; // field subspec must be valid } } - + $this->ref($this->currentSpec['field'], $this->field); } $fieldIndex++; @@ -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. * @@ -316,7 +316,7 @@ private function validateSubSpec() break; case '~': - if (0 < count( + if (0 < count( array_uintersect( $leftSubTerm, $rightSubTerm, @@ -335,7 +335,7 @@ function ($v1, $v2) { break; case '!~': - if (0 < count( + if (0 < count( array_uintersect( $leftSubTerm, $rightSubTerm, diff --git a/test/ReferenceTest.php b/test/ReferenceTest.php index 3877187..b6befd7 100755 --- a/test/ReferenceTest.php +++ b/test/ReferenceTest.php @@ -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)); }