Completed
Push — version2.0 ( af5a57...2f739c )
by Sebastian
06:52
created
src/Seboettg/CiteProc/Util/Factory.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
 
52
+    /**
53
+     * @param string $lang
54
+     */
52 55
     public static function loadLocale($lang) {
53 56
         $directory = __DIR__."/../../../../vendor/academicpuma/locales";
54 57
         $file = $directory . "/locales-" . ($lang) . ".xml";
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Util/StringHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     {
64 64
         $wordArray = explode(" ", $text);
65 65
 
66
-        array_walk($wordArray, function (&$word) {
66
+        array_walk($wordArray, function(&$word) {
67 67
             $word = ucfirst($word);
68 68
         });
69 69
 
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
     public static function capitalizeForTitle($titleString)
74 74
     {
75 75
         if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) {
76
-            $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3];
76
+            $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3];
77 77
         }
78 78
 
79 79
         $wordArray = explode(" ", $titleString);
80 80
 
81
-        array_walk($wordArray, function (&$word) {
81
+        array_walk($wordArray, function(&$word) {
82 82
 
83 83
             $words = explode("-", $word);
84 84
             if (count($words) > 1) {
85
-                array_walk($words, function (&$w) {
85
+                array_walk($words, function(&$w) {
86 86
                     $w = StringHelper::keepLowerCase($w) ? $w : StringHelper::mb_ucfirst($w);
87 87
                 });
88 88
                 $word = implode("-", $words);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     public static function keepLowerCase($word)
97 97
     {
98
-        $lowerCase =  in_array($word, self::PREPOSITIONS) ||
98
+        $lowerCase = in_array($word, self::PREPOSITIONS) ||
99 99
                       in_array($word, self::ARTICLES) ||
100 100
                       in_array($word, self::CONJUNCTIONS) ||
101 101
                       in_array($word, self::ADJECTIVES);
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $then = mb_substr($string, 1, $strlen - 1, $encoding);
111 111
         $encodings = ['ISO-8859-7'];
112 112
         $encoding = mb_detect_encoding($firstChar, $encodings, true);
113
-        return in_array($encoding, $encodings) ? $firstChar.$then : mb_strtoupper($firstChar, $encoding) . $then;
113
+        return in_array($encoding, $encodings) ? $firstChar . $then : mb_strtoupper($firstChar, $encoding) . $then;
114 114
     }
115 115
 
116 116
     public static function explodeBySpaceOrHyphen($string)
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/FormattingTrait.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
             foreach ($this->formattingOptions as $option => $optionValue) {
59 59
                 if ($optionValue === "italic") {
60 60
                     $text = "<i>$text</i>";
61
-                }
62
-                else if ($optionValue === "bold") {
61
+                } else if ($optionValue === "bold") {
63 62
                     $text = "<b>$text</b>";
64 63
                 } else {
65 64
                     $format .= "$option:$optionValue;";
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Name/Name.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         foreach ($node->attributes() as $attribute) {
219 219
             switch ($attribute->getName()) {
220 220
                 case 'and':
221
-                    $and = (string)$attribute;
221
+                    $and = (string) $attribute;
222 222
                     if ("text" === $and) {
223 223
                         $this->and = CiteProc::getContext()->getLocale()->filter('terms', 'and')->single;
224 224
                     } elseif ('symbol' === $and) {
@@ -327,16 +327,16 @@  discard block
 block discarded – undo
327 327
                     if (count($resultNames) === 1) {
328 328
                         $text .= " $etAl";
329 329
                     } else {
330
-                        $text .=  $this->delimiter . $etAl;
330
+                        $text .= $this->delimiter . $etAl;
331 331
                     }
332 332
 
333 333
             }
334 334
         }
335 335
         if ($this->form == 'count') {
336 336
             if ($etAl === false) {
337
-                return (int)count($resultNames);
337
+                return (int) count($resultNames);
338 338
             } else {
339
-                return (int)(count($resultNames) - 1);
339
+                return (int) (count($resultNames) - 1);
340 340
             }
341 341
         }
342 342
         // strip out the last delimiter if not required
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
         if (count($this->nameParts) > 0) {
377 377
             /** @var NamePart $namePart */
378 378
             foreach ($this->nameParts as $namePart) {
379
-                $name->{$namePart->getName()} =   $namePart->render($name);
379
+                $name->{$namePart->getName()} = $namePart->render($name);
380 380
             }
381 381
             $name->suffix = '';
382 382
             $name->{'non-dropping-particle'} = '';
Please login to merge, or discard this patch.