Completed
Push — version2.0 ( bfe52a...7f8367 )
by Sebastian
03:17
created
src/Seboettg/CiteProc/Style/StyleElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
                  * formatting attributes.
45 45
                  */
46 46
                 case 'layout':
47
-                    $this->layout   =   new Layout($child);
47
+                    $this->layout = new Layout($child);
48 48
                     break;
49 49
 
50 50
                 /* cs:citation and cs:bibliography may include a cs:sort child element before the cs:layout element to
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Locale/Term.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
     {
31 31
         $nameParts = explode("-", $name);
32 32
         $attr = "";
33
-        for ($i = count($nameParts)-1; $i >= 0; --$i) {
33
+        for ($i = count($nameParts) - 1; $i >= 0; --$i) {
34 34
             if ($i > 0) {
35 35
                 $attr = ucfirst($nameParts[$i]) . $attr;
36 36
             } else {
37
-                $attr = $nameParts[$i].$attr;
37
+                $attr = $nameParts[$i] . $attr;
38 38
             }
39 39
         }
40 40
         if (!isset($this->{$attr})) {
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Locale/LocaleXmlParserTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
     private function parseXml(\SimpleXMLElement $locale)
53 53
     {
54 54
         foreach ($locale as $node) {
55
-            switch($node->getName()) {
55
+            switch ($node->getName()) {
56 56
                 case 'style-options':
57 57
                     $this->optionsXml->add('options', $node);
58 58
                     foreach ($node->attributes() as $name => $value) {
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Util/Number.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      */
58 58
     public static function getCompareNumber()
59 59
     {
60
-        return function ($numA, $numB, $order) {
60
+        return function($numA, $numB, $order) {
61 61
             if (is_numeric($numA) && is_numeric($numB)) {
62 62
                 $ret = $numA - $numB;
63 63
             } else {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             "I" => 1
139 139
         ];
140 140
 
141
-        if(is_numeric($romanNumber)) {
141
+        if (is_numeric($romanNumber)) {
142 142
             return 0;
143 143
         }
144 144
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         $sum = 0;
155
-        while($current = current($values)) {
155
+        while ($current = current($values)) {
156 156
             $next = next($values);
157 157
             $next > $current ? $sum += $next - $current + 0 * next($values) : $sum += $current;
158 158
         }
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Constraint/IsNumeric.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
         else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) {
57 57
             return Number::roman2Dec($evalValue) !== false;
58 58
         }
59
-        else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){
59
+        else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)) {
60 60
             return true;
61 61
         }
62 62
         return false;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,15 +48,12 @@
 block discarded – undo
48 48
     {
49 49
         if (is_numeric($evalValue)) {
50 50
             return true;
51
-        }
52
-        else if (preg_match(Number::PATTERN_ORDINAL, $evalValue)) {
51
+        } else if (preg_match(Number::PATTERN_ORDINAL, $evalValue)) {
53 52
             $numberFormatter = new NumberFormatter(CiteProc::getContext()->getLocale()->getLanguage(), NumberFormatter::ORDINAL);
54 53
             return $numberFormatter->parse($evalValue) !== false;
55
-        }
56
-        else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) {
54
+        } else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) {
57 55
             return Number::roman2Dec($evalValue) !== false;
58
-        }
59
-        else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){
56
+        } else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){
60 57
             return true;
61 58
         }
62 59
         return false;
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Styles/DelimiterTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
         /** @var \SimpleXMLElement $attribute */
19 19
         foreach ($node->attributes() as $attribute) {
20 20
             /** @var string $name */
21
-            $name = (string)$attribute->getName();
22
-            $value = (string)$attribute;
21
+            $name = (string) $attribute->getName();
22
+            $value = (string) $attribute;
23 23
 
24 24
             switch ($name) {
25 25
                 case 'prefix':
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Layout.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
         if (CiteProc::getContext()->isModeBibliography()) {
55 55
             if (is_array($data)) {
56 56
                 $arr = [];
57
-                foreach ($data as $item) {
58
-                    ++self::$numberOfCitedItems;
57
+                foreach ($data as $item) {++self::$numberOfCitedItems;
59 58
                     $arr[] = $this->wrapBibEntry($this->renderSingle($item));
60 59
                 }
61 60
                 $ret .= implode($this->delimiter, $arr);
@@ -63,7 +62,7 @@  discard block
 block discarded – undo
63 62
                 $ret .= $this->wrapBibEntry($this->renderSingle($data));
64 63
             }
65 64
 
66
-            return "<div class=\"csl-bib-body\">".$ret."\n</div>";
65
+            return "<div class=\"csl-bib-body\">" . $ret . "\n</div>";
67 66
 
68 67
         } else if (CiteProc::getContext()->isModeCitation()) {
69 68
             if (is_array($data)) {
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/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.