Passed
Push — master ( 6258cd...428df7 )
by Sebastian
05:23 queued 11s
created
src/Rendering/Name/Name.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         foreach ($node->attributes() as $attribute) {
107 107
             switch ($attribute->getName()) {
108 108
             case 'form':
109
-                $this->form = (string)$attribute;
109
+                $this->form = (string) $attribute;
110 110
                 break;
111 111
             }
112 112
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         cs:names element (taking into account the effects of et-al abbreviation and editor/translator collapsing),
170 170
         which allows for advanced sorting. */
171 171
         if ($this->form == 'count') {
172
-            return (int)count($resultNames);
172
+            return (int) count($resultNames);
173 173
         }
174 174
 
175 175
         return $text;
@@ -269,17 +269,17 @@  discard block
 block discarded – undo
269 269
 
270 270
             switch ($this->delimiterPrecedesEtAl) {
271 271
             case 'never':
272
-                $text = $text . " " . $this->etAl;
272
+                $text = $text." ".$this->etAl;
273 273
                 break;
274 274
             case 'always':
275
-                $text = $text . $this->delimiter . $this->etAl;
275
+                $text = $text.$this->delimiter.$this->etAl;
276 276
                 break;
277 277
             case 'contextual':
278 278
             default:
279 279
                 if (count($resultNames) === 1) {
280
-                    $text .= " " . $this->etAl;
280
+                    $text .= " ".$this->etAl;
281 281
                 } else {
282
-                    $text .= $this->delimiter . $this->etAl;
282
+                    $text .= $this->delimiter.$this->etAl;
283 283
                 }
284 284
             }
285 285
         }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                 $text = implode(" ", $resultNames);
459 459
             } else { // >2
460 460
                 $lastName = array_pop($resultNames);
461
-                $text = implode($this->delimiter, $resultNames) . " " . $lastName;
461
+                $text = implode($this->delimiter, $resultNames)." ".$lastName;
462 462
             }
463 463
         }
464 464
         return $text;
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
     {
488 488
         $count = count($resultNames);
489 489
         if (!empty($this->and) && $count > 1 && empty($this->etAl)) {
490
-            $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined
490
+            $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined
491 491
             // set prefixed last name at the last position of $resultNames array
492 492
             $resultNames[count($resultNames) - 1] = $new;
493 493
         }
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         if (StringHelper::isLatinString($normalizedName) || StringHelper::isCyrillicString($normalizedName)) {
536 536
             if ($this->form === "long"
537 537
                 && $nameAsSortOrder
538
-                && ((string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER
539
-                || (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
538
+                && ((string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER
539
+                || (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
540 540
             ) {
541 541
                 // [La] [Fontaine], [Jean] [de], [III]
542 542
                 NameHelper::prependParticleTo($data, "family", "non-dropping-particle");
@@ -544,25 +544,25 @@  discard block
 block discarded – undo
544 544
 
545 545
                 list($family, $given) = $this->renderNameParts($data);
546 546
 
547
-                $text = $family . (!empty($given) ? $this->sortSeparator . $given : "");
548
-                $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
547
+                $text = $family.(!empty($given) ? $this->sortSeparator.$given : "");
548
+                $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
549 549
             } elseif ($this->form === "long"
550 550
                 && $nameAsSortOrder
551 551
                 && (is_null($demoteNonDroppingParticle)
552
-                || (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
552
+                || (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
553 553
             ) {
554 554
                 // [Fontaine], [Jean] [de] [La], [III]
555 555
                 NameHelper::appendParticleTo($data, "given", "dropping-particle");
556 556
                 NameHelper::appendParticleTo($data, "given", "non-dropping-particle");
557 557
                 list($family, $given) = $this->renderNameParts($data);
558 558
                 $text = $family;
559
-                $text .= !empty($given) ? $this->sortSeparator . $given : "";
560
-                $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
559
+                $text .= !empty($given) ? $this->sortSeparator.$given : "";
560
+                $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
561 561
             } elseif ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) {
562 562
                 list($family, $given) = $this->renderNameParts($data);
563 563
                 $text = $family;
564
-                $text .= !empty($given) ? $this->delimiter . $given : "";
565
-                $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
564
+                $text .= !empty($given) ? $this->delimiter.$given : "";
565
+                $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
566 566
             } elseif ($this->form === "short") {
567 567
                 // [La] [Fontaine]
568 568
                 NameHelper::prependParticleTo($data, "family", "non-dropping-particle");
@@ -573,12 +573,12 @@  discard block
 block discarded – undo
573 573
                 NameHelper::prependParticleTo($data, "family", "dropping-particle");
574 574
                 NameHelper::appendParticleTo($data, "family", "suffix");
575 575
                 list($family, $given) = $this->renderNameParts($data);
576
-                $text = !empty($given) ? $given . " " . $family : $family;
576
+                $text = !empty($given) ? $given." ".$family : $family;
577 577
             }
578 578
         } else if (StringHelper::isAsianString(NameHelper::normalizeName($data))) {
579
-            $text = $this->form === "long" ? $data->family . $data->given : $data->family;
579
+            $text = $this->form === "long" ? $data->family.$data->given : $data->family;
580 580
         } else {
581
-            $text = $this->form === "long" ? $data->family . " " . $data->given : $data->family;
581
+            $text = $this->form === "long" ? $data->family." ".$data->given : $data->family;
582 582
         }
583 583
         return $text;
584 584
     }
Please login to merge, or discard this patch.