@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | foreach ($node->attributes() as $attribute) { |
| 103 | 103 | switch ($attribute->getName()) { |
| 104 | 104 | case 'form': |
| 105 | - $this->form = (string)$attribute; |
|
| 105 | + $this->form = (string) $attribute; |
|
| 106 | 106 | break; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | cs:names element (taking into account the effects of et-al abbreviation and editor/translator collapsing), |
| 167 | 167 | which allows for advanced sorting. */ |
| 168 | 168 | if ($this->form == 'count') { |
| 169 | - return (int)count($resultNames); |
|
| 169 | + return (int) count($resultNames); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | return $text; |
@@ -270,17 +270,17 @@ discard block |
||
| 270 | 270 | |
| 271 | 271 | switch ($this->delimiterPrecedesEtAl) { |
| 272 | 272 | case 'never': |
| 273 | - $text = $text . " " . $this->etAl; |
|
| 273 | + $text = $text." ".$this->etAl; |
|
| 274 | 274 | break; |
| 275 | 275 | case 'always': |
| 276 | - $text = $text . $this->delimiter . $this->etAl; |
|
| 276 | + $text = $text.$this->delimiter.$this->etAl; |
|
| 277 | 277 | break; |
| 278 | 278 | case 'contextual': |
| 279 | 279 | default: |
| 280 | 280 | if (count($resultNames) === 1) { |
| 281 | - $text .= " " . $this->etAl; |
|
| 281 | + $text .= " ".$this->etAl; |
|
| 282 | 282 | } else { |
| 283 | - $text .= $this->delimiter . $this->etAl; |
|
| 283 | + $text .= $this->delimiter.$this->etAl; |
|
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 | } |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | $text = implode(" ", $resultNames); |
| 466 | 466 | } else { // >2 |
| 467 | 467 | $lastName = array_pop($resultNames); |
| 468 | - $text = implode($this->delimiter, $resultNames) . " " . $lastName; |
|
| 468 | + $text = implode($this->delimiter, $resultNames)." ".$lastName; |
|
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | return $text; |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | { |
| 495 | 495 | $count = count($resultNames); |
| 496 | 496 | if (!empty($this->and) && $count > 1 && empty($this->etAl)) { |
| 497 | - $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 497 | + $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 498 | 498 | $resultNames[count($resultNames) - 1] = $new; //set prefixed last name at the last position of $resultNames array |
| 499 | 499 | } |
| 500 | 500 | } |
@@ -540,8 +540,8 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | if (StringHelper::isLatinString(NameHelper::normalizeName($data)) || StringHelper::isCyrillicString(NameHelper::normalizeName($data))) { |
| 542 | 542 | if ($this->form === "long" && $nameAsSortOrder && |
| 543 | - ((string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER || |
|
| 544 | - (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY) |
|
| 543 | + ((string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER || |
|
| 544 | + (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY) |
|
| 545 | 545 | ) { |
| 546 | 546 | |
| 547 | 547 | // [La] [Fontaine], [Jean] [de], [III] |
@@ -550,11 +550,11 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | list($family, $given) = $this->renderNameParts($data); |
| 552 | 552 | |
| 553 | - $text = $family . (!empty($given) ? $this->sortSeparator . $given : ""); |
|
| 554 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 553 | + $text = $family.(!empty($given) ? $this->sortSeparator.$given : ""); |
|
| 554 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 555 | 555 | } else if ($this->form === "long" && $nameAsSortOrder && |
| 556 | 556 | (is_null($demoteNonDroppingParticle) || |
| 557 | - (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT) |
|
| 557 | + (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT) |
|
| 558 | 558 | ) { |
| 559 | 559 | // [Fontaine], [Jean] [de] [La], [III] |
| 560 | 560 | |
@@ -562,14 +562,14 @@ discard block |
||
| 562 | 562 | NameHelper::appendParticleTo($data, "given", "non-dropping-particle"); |
| 563 | 563 | list($family, $given) = $this->renderNameParts($data); |
| 564 | 564 | $text = $family; |
| 565 | - $text .= !empty($given) ? $this->sortSeparator . $given : ""; |
|
| 566 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 565 | + $text .= !empty($given) ? $this->sortSeparator.$given : ""; |
|
| 566 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 567 | 567 | |
| 568 | 568 | } else if ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) { |
| 569 | 569 | list($family, $given) = $this->renderNameParts($data); |
| 570 | 570 | $text = $family; |
| 571 | - $text .= !empty($given) ? $this->delimiter . $given : ""; |
|
| 572 | - $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : ""; |
|
| 571 | + $text .= !empty($given) ? $this->delimiter.$given : ""; |
|
| 572 | + $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : ""; |
|
| 573 | 573 | } else if ($this->form === "short") { |
| 574 | 574 | // [La] [Fontaine] |
| 575 | 575 | NameHelper::prependParticleTo($data, "family", "non-dropping-particle"); |
@@ -581,10 +581,10 @@ discard block |
||
| 581 | 581 | NameHelper::prependParticleTo($data, "family", "dropping-particle"); |
| 582 | 582 | NameHelper::appendParticleTo($data, "family", "suffix"); |
| 583 | 583 | list($family, $given) = $this->renderNameParts($data); |
| 584 | - $text = !empty($given) ? $given . " " . $family : $family; |
|
| 584 | + $text = !empty($given) ? $given." ".$family : $family; |
|
| 585 | 585 | } |
| 586 | 586 | } else { |
| 587 | - $text = $this->form === "long" ? $data->family . " " . $data->given : $data->family; |
|
| 587 | + $text = $this->form === "long" ? $data->family." ".$data->given : $data->family; |
|
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | return $text; |