@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | foreach ($this->conditionVariables as $variable) { |
| 72 | 72 | $conditionMatched |= $this->matchForVariable($variable, $value); |
| 73 | 73 | } |
| 74 | - return (bool)$conditionMatched; |
|
| 74 | + return (bool) $conditionMatched; |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | private function matchAll($value) |
@@ -80,6 +80,6 @@ discard block |
||
| 80 | 80 | foreach ($this->conditionVariables as $variable) { |
| 81 | 81 | $conditionMatched &= $this->matchForVariable($variable, $value); |
| 82 | 82 | } |
| 83 | - return (bool)$conditionMatched; |
|
| 83 | + return (bool) $conditionMatched; |
|
| 84 | 84 | } |
| 85 | 85 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $dp = $dateParts->toArray(); |
| 31 | 31 | $dateParts_ = []; |
| 32 | - array_walk($dp, function ($datePart, $key) use (&$dateParts_) { |
|
| 32 | + array_walk($dp, function($datePart, $key) use (&$dateParts_) { |
|
| 33 | 33 | if (strpos($key, "year") !== false || strpos($key, "month") !== false) { |
| 34 | 34 | $dateParts_["yearmonth"][] = $datePart; |
| 35 | 35 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | $dp = $dateParts->toArray(); |
| 31 | 31 | $dateParts_ = []; |
| 32 | - array_walk($dp, function ($datePart, $key) use (&$dateParts_) { |
|
| 32 | + array_walk($dp, function($datePart, $key) use (&$dateParts_) { |
|
| 33 | 33 | if (strpos($key, "year") !== false || strpos($key, "day") !== false) { |
| 34 | 34 | $dateParts_["yearday"][] = $datePart; |
| 35 | 35 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $dp = $dateParts->toArray(); |
| 30 | 30 | $dateParts_ = []; |
| 31 | - array_walk($dp, function ($datePart, $key) use (&$dateParts_) { |
|
| 31 | + array_walk($dp, function($datePart, $key) use (&$dateParts_) { |
|
| 32 | 32 | //$bit = sprintf("%03d", decbin($differentParts)); |
| 33 | 33 | if (strpos($key, "month") !== false || strpos($key, "day") !== false) { |
| 34 | 34 | $dateParts_["monthday"][] = $datePart; |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | public function flatten($array) |
| 152 | 152 | { |
| 153 | 153 | $returnArray = []; |
| 154 | - array_walk_recursive($array, function ($a) use (&$returnArray) { |
|
| 154 | + array_walk_recursive($array, function($a) use (&$returnArray) { |
|
| 155 | 155 | $returnArray[] = $a; |
| 156 | 156 | }); |
| 157 | 157 | return $returnArray; |
@@ -430,7 +430,7 @@ |
||
| 430 | 430 | |
| 431 | 431 | public function getCitationItemById($id) |
| 432 | 432 | { |
| 433 | - return $this->citationItems->filter(function ($item) use ($id) { |
|
| 433 | + return $this->citationItems->filter(function($item) use ($id) { |
|
| 434 | 434 | return $item->id === $id; |
| 435 | 435 | })->current(); |
| 436 | 436 | } |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | public static function mapLocatorLabelToRenderVariable($locatorTerm) |
| 40 | 40 | { |
| 41 | 41 | if ($locatorTerm instanceof Locator) { |
| 42 | - $locatorTerm = (string)$locatorTerm; |
|
| 42 | + $locatorTerm = (string) $locatorTerm; |
|
| 43 | 43 | } |
| 44 | 44 | return |
| 45 | 45 | array_key_exists($locatorTerm, self::LABEL_TO_VARIABLE_MAP) ? |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $resultNames[] = $this->formatName($name, $rank); |
| 358 | 358 | } |
| 359 | 359 | break; |
| 360 | - /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
| 360 | + /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
| 361 | 361 | variable. */ |
| 362 | 362 | case SubsequentAuthorSubstituteRule::PARTIAL_FIRST: |
| 363 | 363 | if ($rank === 0) { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | } |
| 372 | 372 | break; |
| 373 | 373 | |
| 374 | - /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
| 374 | + /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
| 375 | 375 | subsequent-author-substitute substitutes for each rendered name. */ |
| 376 | 376 | case SubsequentAuthorSubstituteRule::COMPLETE_EACH: |
| 377 | 377 | try { |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $text = implode(" ", $resultNames); |
| 454 | 454 | } else { // >2 |
| 455 | 455 | $lastName = array_pop($resultNames); |
| 456 | - $text = implode($this->delimiter, $resultNames)." ".$lastName; |
|
| 456 | + $text = implode($this->delimiter, $resultNames) . " " . $lastName; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | return $text; |
@@ -539,8 +539,8 @@ discard block |
||
| 539 | 539 | |
| 540 | 540 | list($family, $given) = $this->renderNameParts($data); |
| 541 | 541 | |
| 542 | - $text = $family.(!empty($given) ? $this->sortSeparator.$given : ""); |
|
| 543 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 542 | + $text = $family . (!empty($given) ? $this->sortSeparator . $given : ""); |
|
| 543 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 544 | 544 | } elseif ($this->form === "long" |
| 545 | 545 | && $nameAsSortOrder |
| 546 | 546 | && (is_null($demoteNonDroppingParticle) |
@@ -551,13 +551,13 @@ discard block |
||
| 551 | 551 | NameHelper::appendParticleTo($data, "given", "non-dropping-particle"); |
| 552 | 552 | list($family, $given) = $this->renderNameParts($data); |
| 553 | 553 | $text = $family; |
| 554 | - $text .= !empty($given) ? $this->sortSeparator.$given : ""; |
|
| 555 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 554 | + $text .= !empty($given) ? $this->sortSeparator . $given : ""; |
|
| 555 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 556 | 556 | } elseif ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) { |
| 557 | 557 | list($family, $given) = $this->renderNameParts($data); |
| 558 | 558 | $text = $family; |
| 559 | - $text .= !empty($given) ? $this->delimiter.$given : ""; |
|
| 560 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 559 | + $text .= !empty($given) ? $this->delimiter . $given : ""; |
|
| 560 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 561 | 561 | } elseif ($this->form === "short") { |
| 562 | 562 | // [La] [Fontaine] |
| 563 | 563 | NameHelper::prependParticleTo($data, "family", "non-dropping-particle"); |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | NameHelper::prependParticleTo($data, "family", "dropping-particle"); |
| 569 | 569 | NameHelper::appendParticleTo($data, "family", "suffix"); |
| 570 | 570 | list($family, $given) = $this->renderNameParts($data); |
| 571 | - $text = !empty($given) ? $given." ".$family : $family; |
|
| 571 | + $text = !empty($given) ? $given . " " . $family : $family; |
|
| 572 | 572 | } |
| 573 | 573 | } elseif (StringHelper::isAsianString(NameHelper::normalizeName($data))) { |
| 574 | 574 | $text = $this->form === "long" ? $data->family . $data->given : $data->family; |
@@ -44,9 +44,9 @@ |
||
| 44 | 44 | 'chapter-number', // chapter number |
| 45 | 45 | 'collection-number', // number identifying the collection holding the item (e.g. the series number for a book) |
| 46 | 46 | 'edition', // (container) edition holding the item (e.g. “3” when citing a chapter in the third |
| 47 | - // edition of a book) |
|
| 47 | + // edition of a book) |
|
| 48 | 48 | 'issue', // (container) issue holding the item (e.g. “5” when citing a journal article from |
| 49 | - // journal volume 2, issue 5) |
|
| 49 | + // journal volume 2, issue 5) |
|
| 50 | 50 | 'number', // number identifying the item (e.g. a report number) |
| 51 | 51 | 'number-of-pages', // total number of pages of the cited item |
| 52 | 52 | 'number-of-volumes', // total number of volumes, usable for citing multi-volume books and such |
@@ -169,7 +169,7 @@ |
||
| 169 | 169 | $parent = null; |
| 170 | 170 | $names = new Names( |
| 171 | 171 | new SimpleXMLElement( |
| 172 | - "<names variable=\"$variable\" delimiter=\"-\">". |
|
| 172 | + "<names variable=\"$variable\" delimiter=\"-\">" . |
|
| 173 | 173 | "<name form=\"long\" sort-separator=\",\" name-as-sort-order=\"all\"/></names>" |
| 174 | 174 | ), |
| 175 | 175 | $parent |