@@ -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 { |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | $text = implode(" ", $resultNames); |
| 457 | 457 | } else { // >2 |
| 458 | 458 | $lastName = array_pop($resultNames); |
| 459 | - $text = implode($this->delimiter, $resultNames)." ".$lastName; |
|
| 459 | + $text = implode($this->delimiter, $resultNames) . " " . $lastName; |
|
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | return $text; |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | { |
| 486 | 486 | $count = count($resultNames); |
| 487 | 487 | if (!empty($this->and) && $count > 1 && empty($this->etAl)) { |
| 488 | - $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 488 | + $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 489 | 489 | // set prefixed last name at the last position of $resultNames array |
| 490 | 490 | $resultNames[count($resultNames) - 1] = $new; |
| 491 | 491 | } |
@@ -542,8 +542,8 @@ discard block |
||
| 542 | 542 | |
| 543 | 543 | list($family, $given) = $this->renderNameParts($data); |
| 544 | 544 | |
| 545 | - $text = $family.(!empty($given) ? $this->sortSeparator.$given : ""); |
|
| 546 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 545 | + $text = $family . (!empty($given) ? $this->sortSeparator . $given : ""); |
|
| 546 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 547 | 547 | } elseif ($this->form === "long" |
| 548 | 548 | && $nameAsSortOrder |
| 549 | 549 | && (is_null($demoteNonDroppingParticle) |
@@ -554,13 +554,13 @@ discard block |
||
| 554 | 554 | NameHelper::appendParticleTo($data, "given", "non-dropping-particle"); |
| 555 | 555 | list($family, $given) = $this->renderNameParts($data); |
| 556 | 556 | $text = $family; |
| 557 | - $text .= !empty($given) ? $this->sortSeparator.$given : ""; |
|
| 558 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 557 | + $text .= !empty($given) ? $this->sortSeparator . $given : ""; |
|
| 558 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 559 | 559 | } elseif ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) { |
| 560 | 560 | list($family, $given) = $this->renderNameParts($data); |
| 561 | 561 | $text = $family; |
| 562 | - $text .= !empty($given) ? $this->delimiter.$given : ""; |
|
| 563 | - $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 562 | + $text .= !empty($given) ? $this->delimiter . $given : ""; |
|
| 563 | + $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 564 | 564 | } elseif ($this->form === "short") { |
| 565 | 565 | // [La] [Fontaine] |
| 566 | 566 | NameHelper::prependParticleTo($data, "family", "non-dropping-particle"); |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | NameHelper::prependParticleTo($data, "family", "dropping-particle"); |
| 572 | 572 | NameHelper::appendParticleTo($data, "family", "suffix"); |
| 573 | 573 | list($family, $given) = $this->renderNameParts($data); |
| 574 | - $text = !empty($given) ? $given." ".$family : $family; |
|
| 574 | + $text = !empty($given) ? $given . " " . $family : $family; |
|
| 575 | 575 | } |
| 576 | 576 | } elseif (StringHelper::isAsianString(NameHelper::normalizeName($data))) { |
| 577 | 577 | $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 |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | if (!in_array($this->display, self::$allowedValues)) { |
| 58 | 58 | return $text; |
| 59 | 59 | } |
| 60 | - $divStyle = "class=\"csl-".$this->display."\""; |
|
| 60 | + $divStyle = "class=\"csl-" . $this->display . "\""; |
|
| 61 | 61 | return "<div $divStyle>$text</div>"; |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | if (empty($punctuationSign) || preg_match("/^\s+$/", $punctuationSign)) { |
| 43 | 43 | return $subject; |
| 44 | 44 | } |
| 45 | - $pattern = '/'.preg_quote(trim($punctuationSign), '/').'{2,}/'; |
|
| 45 | + $pattern = '/' . preg_quote(trim($punctuationSign), '/') . '{2,}/'; |
|
| 46 | 46 | if (preg_match($pattern, $subject)) { |
| 47 | 47 | return preg_replace($pattern, $punctuationSign, $subject); |
| 48 | 48 | } |
@@ -133,8 +133,8 @@ |
||
| 133 | 133 | public function renderNumeric() |
| 134 | 134 | { |
| 135 | 135 | $ret = $this->year; |
| 136 | - $ret .= $this->month > 0 && $this->month < 13 ? "-".sprintf("%02s", $this->month) : ""; |
|
| 137 | - $ret .= $this->day > 0 && $this->day < 32 ? "-".sprintf("%02s", $this->day) : ""; |
|
| 136 | + $ret .= $this->month > 0 && $this->month < 13 ? "-" . sprintf("%02s", $this->month) : ""; |
|
| 137 | + $ret .= $this->day > 0 && $this->day < 32 ? "-" . sprintf("%02s", $this->day) : ""; |
|
| 138 | 138 | return $ret; |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public static function appendParticleTo(&$data, $namePart, $particle) |
| 71 | 71 | { |
| 72 | 72 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
| 73 | - $data->{$namePart} = $data->{$namePart}." ".$data->{$particle}; // append $particle to $namePart |
|
| 73 | + $data->{$namePart} = $data->{$namePart} . " " . $data->{$particle}; // append $particle to $namePart |
|
| 74 | 74 | unset($data->{$particle}); //remove particle from $data |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public static function prependParticleTo(&$data, $namePart, $particle) |
| 85 | 85 | { |
| 86 | 86 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
| 87 | - $data->{$namePart} = $data->{$particle}." ".$data->{$namePart}; //prepend $particle to $namePart |
|
| 87 | + $data->{$namePart} = $data->{$particle} . " " . $data->{$namePart}; //prepend $particle to $namePart |
|
| 88 | 88 | unset($data->{$particle}); //remove particle from $data |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | return false; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - array_walk($persons1, function ($name, $key) use ($persons2, &$same) { |
|
| 105 | + array_walk($persons1, function($name, $key) use ($persons2, &$same) { |
|
| 106 | 106 | $family1 = $name->family; |
| 107 | 107 | $family2 = $persons2[$key]->family; |
| 108 | 108 | $same = $same && ($family1 === $family2); |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if (empty($data->family)) { |
| 122 | 122 | throw new CiteProcException("Illegal argument. Name has no family name."); |
| 123 | 123 | } |
| 124 | - return $data->family.(isset($data->given) ? $data->given : ""); |
|
| 124 | + return $data->family . (isset($data->given) ? $data->given : ""); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | public static function addExtendedMarkup($nameVar, $nameItem, $formattedName) |