Passed
Pull Request — master (#139)
by Sebastian
15:27 queued 07:16
created
src/Styles/ConsecutivePunctuationCharacterTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         if (empty($punctuationSign) || preg_match("/^\s+$/", $punctuationSign)) {
43 43
             return $subject;
44 44
         }
45
-        $pattern = '/'.preg_quote(trim($punctuationSign), '/').'{2,}/';
45
+        $pattern = '/' . preg_quote(trim($punctuationSign), '/') . '{2,}/';
46 46
         if (preg_match($pattern, $subject)) {
47 47
             return preg_replace($pattern, $punctuationSign, $subject);
48 48
         }
Please login to merge, or discard this patch.
src/Styles/Css/CssRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
      */
65 65
     public function __toString()
66 66
     {
67
-        $directives = "\t".implode("\n\t", $this->directives->toArray());
68
-        return $this->selectorType.$this->selector." {\n".$directives."\n}\n";
67
+        $directives = "\t" . implode("\n\t", $this->directives->toArray());
68
+        return $this->selectorType . $this->selector . " {\n" . $directives . "\n}\n";
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
src/Rendering/Date/DateTime.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -133,8 +133,8 @@
 block discarded – undo
133 133
     public function renderNumeric()
134 134
     {
135 135
         $ret  = $this->year;
136
-        $ret .= $this->month > 0 && $this->month < 13 ? "-".sprintf("%02s", $this->month) : "";
137
-        $ret .= $this->day > 0 && $this->day < 32 ? "-".sprintf("%02s", $this->day) : "";
136
+        $ret .= $this->month > 0 && $this->month < 13 ? "-" . sprintf("%02s", $this->month) : "";
137
+        $ret .= $this->day > 0 && $this->day < 32 ? "-" . sprintf("%02s", $this->day) : "";
138 138
         return $ret;
139 139
     }
140 140
 }
Please login to merge, or discard this patch.
src/Util/NameHelper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public static function appendParticleTo(&$data, $namePart, $particle)
71 71
     {
72 72
         if (isset($data->{$particle}) && isset($data->{$namePart})) {
73
-            $data->{$namePart} = $data->{$namePart}." ".$data->{$particle}; // append $particle to $namePart
73
+            $data->{$namePart} = $data->{$namePart} . " " . $data->{$particle}; // append $particle to $namePart
74 74
             unset($data->{$particle}); //remove particle from $data
75 75
         }
76 76
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public static function prependParticleTo(&$data, $namePart, $particle)
85 85
     {
86 86
         if (isset($data->{$particle}) && isset($data->{$namePart})) {
87
-            $data->{$namePart} = $data->{$particle}." ".$data->{$namePart}; //prepend $particle to $namePart
87
+            $data->{$namePart} = $data->{$particle} . " " . $data->{$namePart}; //prepend $particle to $namePart
88 88
             unset($data->{$particle}); //remove particle from $data
89 89
         }
90 90
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             return false;
103 103
         }
104 104
 
105
-        array_walk($persons1, function ($name, $key) use ($persons2, &$same) {
105
+        array_walk($persons1, function($name, $key) use ($persons2, &$same) {
106 106
             $family1 = $name->family;
107 107
             $family2 = $persons2[$key]->family;
108 108
             $same = $same && ($family1 === $family2);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         if (empty($data->family)) {
122 122
             throw new CiteProcException("Illegal argument. Name has no family name.");
123 123
         }
124
-        return $data->family.(isset($data->given) ? $data->given : "");
124
+        return $data->family . (isset($data->given) ? $data->given : "");
125 125
     }
126 126
 
127 127
     public static function addExtendedMarkup($nameVar, $nameItem, $formattedName)
Please login to merge, or discard this patch.
src/Util/PageHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
                 $digitFrom = $from[$i];
69 69
                 if ($digitTo !== $digitFrom) {
70
-                    $resTo = $digitTo.$resTo;
70
+                    $resTo = $digitTo . $resTo;
71 71
                 }
72 72
             }
73 73
             return $resTo;
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
     private static function renderChicago($from, $to)
79 79
     {
80 80
         if ($from > 100 && ($from % 100 > 0) && intval(($from / 100), 10) === intval(($to / 100), 10)) {
81
-            return "".($to % 100);
81
+            return "" . ($to % 100);
82 82
         } elseif ($from >= 10000) {
83
-            return "".($to % 1000);
83
+            return "" . ($to % 1000);
84 84
         }
85 85
         return $to;
86 86
     }
Please login to merge, or discard this patch.
src/Rendering/Term/Punctuation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
22 22
         $values = new ArrayList();
23 23
         return $values
24 24
             ->setArray(Punctuation::toArray())
25
-            ->map(function (string $punctuation) {
25
+            ->map(function(string $punctuation) {
26 26
                 return CiteProc::getContext()->getLocale()->filter("terms", $punctuation)->single;
27 27
             })
28
-            ->collect(function ($items) {
28
+            ->collect(function($items) {
29 29
                 return array_values($items);
30 30
             });
31 31
     }
Please login to merge, or discard this patch.
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     {
78 78
         $wordArray = explode(" ", $text);
79 79
 
80
-        array_walk($wordArray, function (&$word) {
80
+        array_walk($wordArray, function(&$word) {
81 81
             $word = ucfirst($word);
82 82
         });
83 83
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             return "";
95 95
         }
96 96
         if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) {
97
-            $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3];
97
+            $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3];
98 98
         }
99 99
         $pattern = "/(\s|\/)/";
100 100
         if (!preg_match($pattern, $titleString, $matches)) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         /** @noinspection PhpInternalEntityUsedInspection */
149 149
         $encoding = mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true);
150 150
         return in_array($encoding, self::ISO_ENCODINGS) ?
151
-            mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then;
151
+            mb_strtoupper($firstChar, $encoding) . $then : $firstChar . $then;
152 152
     }
153 153
     // phpcs:disable
154 154
     public static function mb_strrev($string)
@@ -197,13 +197,13 @@  discard block
 block discarded – undo
197 197
             foreach ($spaceExploded as $givenPart) {
198 198
                 $firstLetter = mb_substr($givenPart, 0, 1, "UTF-8");
199 199
                 if (StringHelper::isLatinString($firstLetter)) {
200
-                    $res .= ctype_upper($firstLetter) ? $firstLetter.$initializeSign : " ".$givenPart." ";
200
+                    $res .= ctype_upper($firstLetter) ? $firstLetter . $initializeSign : " " . $givenPart . " ";
201 201
                 } else {
202
-                    $res .= $firstLetter.$initializeSign;
202
+                    $res .= $firstLetter . $initializeSign;
203 203
                 }
204 204
             }
205 205
             if ($i < count($exploded) - 1 && $initializeWithHyphen) {
206
-                $res = rtrim($res)."-";
206
+                $res = rtrim($res) . "-";
207 207
             }
208 208
             ++$i;
209 209
         }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
         $innerCloseQuote
267 267
     ) {
268 268
         if (preg_match("/(.*)$outerOpenQuote(.+)$outerCloseQuote(.*)/u", $text, $match)) {
269
-            return $match[1].$innerOpenQuote.$match[2].$innerCloseQuote.$match[3];
269
+            return $match[1] . $innerOpenQuote . $match[2] . $innerCloseQuote . $match[3];
270 270
         }
271 271
         return $text;
272 272
     }
Please login to merge, or discard this patch.
src/Util/Factory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@
 block discarded – undo
54 54
      */
55 55
     public static function create($node, $param = null)
56 56
     {
57
-        $nodeClass = self::CITE_PROC_NODE_NAMESPACE.self::$nodes[$node->getName()];
57
+        $nodeClass = self::CITE_PROC_NODE_NAMESPACE . self::$nodes[$node->getName()];
58 58
         if (!class_exists($nodeClass)) {
59
-            throw new InvalidStylesheetException("For node {$node->getName()} ".
60
-                "does not exist any counterpart class \"".$nodeClass.
59
+            throw new InvalidStylesheetException("For node {$node->getName()} " .
60
+                "does not exist any counterpart class \"" . $nodeClass .
61 61
                 "\". The given stylesheet seems to be invalid.");
62 62
         }
63 63
         if ($param != null) {
Please login to merge, or discard this patch.