Passed
Push — new-api ( 9a923b...62947e )
by Sebastian
04:28
created
src/Util/DateHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             $dateTime = new DateTime($date->{'raw'});
60 60
             $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]];
61 61
         } catch (Exception $e) {
62
-            throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e);
62
+            throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e);
63 63
         }
64 64
 
65 65
         return $arr;
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             } elseif ($match === "any" && count($dateParts) === 2) {
112 112
                 return true;
113 113
             } else {
114
-                $ret = ($match === "all") ? $ret&true : $ret|true;
114
+                $ret = ($match === "all") ? $ret & true : $ret | true;
115 115
             }
116 116
         }
117 117
         return (bool) $ret;
Please login to merge, or discard this patch.
src/Util/StringHelper.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $wordArray = explode(" ", $text);
80 80
 
81
-        array_walk($wordArray, function (&$word) {
81
+        array_walk($wordArray, function(&$word) {
82 82
             $word = ucfirst($word);
83 83
         });
84 84
 
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
     public static function capitalizeForTitle($titleString)
93 93
     {
94 94
         if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) {
95
-            $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3];
95
+            $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3];
96 96
         }
97 97
 
98 98
         $wordArray = explode(" ", $titleString);
99 99
 
100
-        array_walk($wordArray, function (&$word) {
100
+        array_walk($wordArray, function(&$word) {
101 101
             $words = explode("-", $word);
102 102
             if (count($words) > 1) {
103
-                array_walk($words, function (&$w) {
103
+                array_walk($words, function(&$w) {
104 104
                     $w = StringHelper::keepLowerCase($w) ? $w : StringHelper::mb_ucfirst($w);
105 105
                 });
106 106
                 $word = implode("-", $words);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         /** @noinspection PhpInternalEntityUsedInspection */
141 141
         $encoding = Mbstring::mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true);
142 142
         return in_array($encoding, self::ISO_ENCODINGS) ?
143
-            Mbstring::mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then;
143
+            Mbstring::mb_strtoupper($firstChar, $encoding) . $then : $firstChar . $then;
144 144
     }
145 145
     // phpcs:disable
146 146
     public static function mb_strrev($string)
@@ -189,15 +189,15 @@  discard block
 block discarded – undo
189 189
             foreach ($spaceExploded as $givenPart) {
190 190
                 $firstLetter = mb_substr($givenPart, 0, 1, "UTF-8");
191 191
                 if (StringHelper::isLatinString($firstLetter)) {
192
-                    $res .= ctype_upper($firstLetter) ? $firstLetter.$initializeSign : " ".$givenPart." ";
192
+                    $res .= ctype_upper($firstLetter) ? $firstLetter . $initializeSign : " " . $givenPart . " ";
193 193
                 } else {
194
-                    $res .= $firstLetter.$initializeSign;
194
+                    $res .= $firstLetter . $initializeSign;
195 195
                 }
196 196
             }
197 197
             if ($i < count($exploded) - 1 && $initializeWithHyphen) {
198
-                $res = rtrim($res)."-";
198
+                $res = rtrim($res) . "-";
199 199
             }
200
-            ++$i;
200
+            ++ $i;
201 201
         }
202 202
         return $res;
203 203
     }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         $innerCloseQuote
259 259
     ) {
260 260
         if (preg_match("/(.*)$outerOpenQuote(.+)$outerCloseQuote(.*)/u", $text, $match)) {
261
-            return $match[1].$innerOpenQuote.$match[2].$innerCloseQuote.$match[3];
261
+            return $match[1] . $innerOpenQuote . $match[2] . $innerCloseQuote . $match[3];
262 262
         }
263 263
         return $text;
264 264
     }
Please login to merge, or discard this patch.
src/Util/NumberHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -52,14 +52,14 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public static function getCompareNumber()
54 54
     {
55
-        return function ($numA, $numB, $order) {
55
+        return function($numA, $numB, $order) {
56 56
             if (is_numeric($numA) && is_numeric($numB)) {
57 57
                 $ret = $numA - $numB;
58 58
             } else {
59 59
                 $ret = strcasecmp($numA, $numB);
60 60
             }
61 61
             if ("descending" === $order) {
62
-                return $ret > 0 ? -1 : 1;
62
+                return $ret > 0 ? - 1 : 1;
63 63
             }
64 64
             return $ret > 0 ? 1 : -1;
65 65
         };
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if ($num < 6000) {
76 76
             $numStr = strrev($num);
77 77
             $len = strlen($numStr);
78
-            for ($pos = 0; $pos < $len; $pos++) {
78
+            for ($pos = 0; $pos < $len; $pos ++) {
79 79
                 $n = $numStr[$pos];
80 80
                 $ret = self::ROMAN_NUMERALS[$pos][$n] . $ret;
81 81
             }
Please login to merge, or discard this patch.