Passed
Push — pr/75 ( f5cb9f...a14152 )
by Sebastian
03:21
created
src/Rendering/Name/Name.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                     $text = implode(" ", $resultNames);
467 467
                 } else { // >2
468 468
                     $lastName = array_pop($resultNames);
469
-                    $text = implode($this->delimiter, $resultNames) . " " . $lastName;
469
+                    $text = implode($this->delimiter, $resultNames)." ".$lastName;
470 470
                 }
471 471
             }
472 472
         }
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
     {
499 499
         $count = count($resultNames);
500 500
         if (!empty($this->and) && $count > 1 && empty($this->etAl)) {
501
-            $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined
501
+            $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined
502 502
             $resultNames[count($resultNames) - 1] = $new; //set prefixed last name at the last position of $resultNames array
503 503
         }
504 504
     }
@@ -544,8 +544,8 @@  discard block
 block discarded – undo
544 544
 
545 545
         if (StringHelper::isLatinString(NameHelper::normalizeName($data)) || StringHelper::isCyrillicString(NameHelper::normalizeName($data))) {
546 546
             if ($this->form === "long" && $nameAsSortOrder &&
547
-                ((string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER ||
548
-                    (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
547
+                ((string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::NEVER ||
548
+                    (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::SORT_ONLY)
549 549
             ) {
550 550
 
551 551
                 // [La] [Fontaine], [Jean] [de], [III]
@@ -554,27 +554,27 @@  discard block
 block discarded – undo
554 554
 
555 555
                 list($family, $given) = $this->renderNameParts($data);
556 556
 
557
-                $text = $family . (!empty($given) ? $this->sortSeparator . $given : "");
558
-                $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
557
+                $text = $family.(!empty($given) ? $this->sortSeparator.$given : "");
558
+                $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
559 559
             } else {
560 560
                 if ($this->form === "long" && $nameAsSortOrder &&
561 561
                     (is_null($demoteNonDroppingParticle) ||
562
-                        (string)$demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
562
+                        (string) $demoteNonDroppingParticle === DemoteNonDroppingParticle::DISPLAY_AND_SORT)
563 563
                 ) {
564 564
                     // [Fontaine], [Jean] [de] [La], [III]
565 565
                     NameHelper::appendParticleTo($data, "given", "dropping-particle");
566 566
                     NameHelper::appendParticleTo($data, "given", "non-dropping-particle");
567 567
                     list($family, $given) = $this->renderNameParts($data);
568 568
                     $text = $family;
569
-                    $text .= !empty($given) ? $this->sortSeparator . $given : "";
570
-                    $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
569
+                    $text .= !empty($given) ? $this->sortSeparator.$given : "";
570
+                    $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
571 571
 
572 572
                 } else {
573 573
                     if ($this->form === "long" && $nameAsSortOrder && empty($demoteNonDroppingParticle)) {
574 574
                         list($family, $given) = $this->renderNameParts($data);
575 575
                         $text = $family;
576
-                        $text .= !empty($given) ? $this->delimiter . $given : "";
577
-                        $text .= !empty($data->suffix) ? $this->sortSeparator . $data->suffix : "";
576
+                        $text .= !empty($given) ? $this->delimiter.$given : "";
577
+                        $text .= !empty($data->suffix) ? $this->sortSeparator.$data->suffix : "";
578 578
                     } else {
579 579
                         if ($this->form === "short") {
580 580
                             // [La] [Fontaine]
@@ -587,13 +587,13 @@  discard block
 block discarded – undo
587 587
                             NameHelper::prependParticleTo($data, "family", "dropping-particle");
588 588
                             NameHelper::appendParticleTo($data, "family", "suffix");
589 589
                             list($family, $given) = $this->renderNameParts($data);
590
-                            $text = !empty($given) ? $given . " " . $family : $family;
590
+                            $text = !empty($given) ? $given." ".$family : $family;
591 591
                         }
592 592
                     }
593 593
                 }
594 594
             }
595 595
         } else {
596
-            $text = $this->form === "long" ? $data->family . $data->given : $data->family;
596
+            $text = $this->form === "long" ? $data->family.$data->given : $data->family;
597 597
         }
598 598
         return $text;
599 599
     }
Please login to merge, or discard this patch.