Passed
Push — new-api ( 4bfe18...7ec1cc )
by Sebastian
05:06
created
src/Util/StringHelper.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  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);
@@ -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,13 +189,13 @@  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 200
             ++$i;
201 201
         }
@@ -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/Rendering/Group.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         $stylesRenderer = StylesRenderer::factory($node);
69 69
         $group->setChildren($children);
70 70
         $group->setStylesRenderer($stylesRenderer);
71
-        $group->setDelimiter((string)$node->attributes()['delimiter']);
71
+        $group->setDelimiter((string) $node->attributes()['delimiter']);
72 72
         return $group;
73 73
     }
74 74
 
Please login to merge, or discard this patch.
src/Rendering/Name/EtAl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
      */
46 46
     public static function factory(SimpleXMLElement $node): EtAl
47 47
     {
48
-        $term = (string)$node->attributes()['term'];
48
+        $term = (string) $node->attributes()['term'];
49 49
         // The term attribute may be set to either “et-al” (the default) or to “and others” to use either term.
50 50
         $term = empty($term) ? "et-al" : $term;
51 51
         $locale = CiteProc::getContext()->getLocale();
Please login to merge, or discard this patch.
src/Rendering/Date/Date.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -191,15 +191,15 @@  discard block
 block discarded – undo
191 191
                 $toRender = 0;
192 192
                 if ($interval->y > 0 && in_array('year', $dateParts)) {
193 193
                     $toRender |= self::DATE_RANGE_STATE_YEAR;
194
-                    $delimiter = $this->dateParts->get($this->form."-year")->getRangeDelimiter();
194
+                    $delimiter = $this->dateParts->get($this->form . "-year")->getRangeDelimiter();
195 195
                 }
196 196
                 if ($interval->m > 0 && $from->getMonth() - $to->getMonth() !== 0 && in_array('month', $dateParts)) {
197 197
                     $toRender |= self::DATE_RANGE_STATE_MONTH;
198
-                    $delimiter = $this->dateParts->get($this->form."-month")->getRangeDelimiter();
198
+                    $delimiter = $this->dateParts->get($this->form . "-month")->getRangeDelimiter();
199 199
                 }
200 200
                 if ($interval->d > 0 && $from->getDay() - $to->getDay() !== 0 && in_array('day', $dateParts)) {
201 201
                     $toRender |= self::DATE_RANGE_STATE_DAY;
202
-                    $delimiter = $this->dateParts->get($this->form."-day")->getRangeDelimiter();
202
+                    $delimiter = $this->dateParts->get($this->form . "-day")->getRangeDelimiter();
203 203
                 }
204 204
                 if ($toRender === self::DATE_RANGE_STATE_NONE) {
205 205
                     $ret .= $this->iterateAndRenderDateParts($dateParts, $data_);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
             }
210 210
 
211 211
             if (isset($var->raw) && preg_match("/(\p{L}+)\s?([\-\–&,])\s?(\p{L}+)/u", $var->raw, $matches)) {
212
-                return $matches[1].$matches[2].$matches[3];
212
+                return $matches[1] . $matches[2] . $matches[3];
213 213
             }
214 214
         } elseif (!empty($this->datePartsAttribute)) {
215 215
             // fallback:
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                     $this->dateParts->add(
368 368
                         "$form-$datePart",
369 369
                         DatePart::factory(
370
-                            new SimpleXMLElement('<date-part name="'.$datePart.'" form="'.$form.'" />')
370
+                            new SimpleXMLElement('<date-part name="' . $datePart . '" form="' . $form . '" />')
371 371
                         )
372 372
                     );
373 373
                 }
Please login to merge, or discard this patch.
src/Style/Options/NameOptions.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -199,49 +199,49 @@
 block discarded – undo
199 199
             if (!empty($attribute)) {
200 200
                 switch ($nameAttribute) {
201 201
                     case 'and':
202
-                        $nameOptions->setAnd((string)$attribute);
202
+                        $nameOptions->setAnd((string) $attribute);
203 203
                         break;
204 204
                     case 'delimiter-precedes-et-al':
205
-                        $nameOptions->setDelimiterPrecedesEtAl((string)$attribute);
205
+                        $nameOptions->setDelimiterPrecedesEtAl((string) $attribute);
206 206
                         break;
207 207
                     case 'delimiter-precedes-last':
208
-                        $nameOptions->setDelimiterPrecedesLast((string)$attribute);
208
+                        $nameOptions->setDelimiterPrecedesLast((string) $attribute);
209 209
                         break;
210 210
                     case 'et-al-min':
211
-                        $nameOptions->setEtAlMin(intval((string)$attribute));
211
+                        $nameOptions->setEtAlMin(intval((string) $attribute));
212 212
                         break;
213 213
                     case 'et-al-use-first':
214
-                        $nameOptions->setEtAlUseFirst(intval((string)$attribute));
214
+                        $nameOptions->setEtAlUseFirst(intval((string) $attribute));
215 215
                         break;
216 216
                     case 'et-al-subsequent-min':
217
-                        $nameOptions->setEtAlSubsequentMin(intval((string)$attribute));
217
+                        $nameOptions->setEtAlSubsequentMin(intval((string) $attribute));
218 218
                         break;
219 219
                     case 'et-al-subsequent-use-first':
220
-                        $nameOptions->setEtAlSubsequentUseFirst(intval((string)$attribute));
220
+                        $nameOptions->setEtAlSubsequentUseFirst(intval((string) $attribute));
221 221
                         break;
222 222
                     case 'et-al-use-last':
223
-                        $nameOptions->setEtAlUseLast(boolval((string)$attribute));
223
+                        $nameOptions->setEtAlUseLast(boolval((string) $attribute));
224 224
                         break;
225 225
                     case 'initialize':
226
-                        $nameOptions->setInitialize(boolval((string)$attribute));
226
+                        $nameOptions->setInitialize(boolval((string) $attribute));
227 227
                         break;
228 228
                     case 'initialize-with':
229
-                        $nameOptions->setInitializeWith((string)$attribute);
229
+                        $nameOptions->setInitializeWith((string) $attribute);
230 230
                         break;
231 231
                     case 'name-as-sort-order':
232
-                        $nameOptions->setNameAsSortOrder((string)$attribute);
232
+                        $nameOptions->setNameAsSortOrder((string) $attribute);
233 233
                         break;
234 234
                     case 'sort-separator':
235
-                        $nameOptions->setSortSeparator((string)$attribute);
235
+                        $nameOptions->setSortSeparator((string) $attribute);
236 236
                         break;
237 237
                     case 'name-form':
238
-                        $nameOptions->setNameForm((string)$attribute);
238
+                        $nameOptions->setNameForm((string) $attribute);
239 239
                         break;
240 240
                     case 'form':
241
-                        $nameOptions->setForm((string)$attribute);
241
+                        $nameOptions->setForm((string) $attribute);
242 242
                         break;
243 243
                     case 'name-delimiter':
244
-                        $nameOptions->setNameDelimiter((string)$attribute);
244
+                        $nameOptions->setNameDelimiter((string) $attribute);
245 245
                         break;
246 246
                 }
247 247
             }
Please login to merge, or discard this patch.
src/Rendering/Text/Text.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $lang = (isset($data->language) && $data->language != 'en') ? $data->language : 'en';
139 139
         $this->stylesRenderer->getTextCase()->setLanguage($lang);
140 140
         $renderedText = "";
141
-        switch ((string)$this->renderType) {
141
+        switch ((string) $this->renderType) {
142 142
             case RenderType::VALUE:
143 143
                 $renderedText = $this->stylesRenderer->renderTextCase($this->renderObject);
144 144
                 break;
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     private function normalizeDateRange($page): string
228 228
     {
229 229
         if (preg_match("/^(\d+)\s?--?\s?(\d+)$/", trim($page), $matches)) {
230
-            return $matches[1]."-".$matches[2];
230
+            return $matches[1] . "-" . $matches[2];
231 231
         }
232 232
         return $page;
233 233
     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         }
273 273
         return $this->stylesRenderer->renderTextCase(
274 274
             StringHelper::clearApostrophes(
275
-                htmlspecialchars((string)$value, ENT_HTML5)
275
+                htmlspecialchars((string) $value, ENT_HTML5)
276 276
             )
277 277
         );
278 278
     }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     private function formatRenderedText($renderedText): string
285 285
     {
286
-        $text = $this->stylesRenderer->renderFormatting((string)$renderedText);
286
+        $text = $this->stylesRenderer->renderFormatting((string) $renderedText);
287 287
         $res = $this->stylesRenderer->renderAffixes($text);
288 288
         if (!empty($res)) {
289 289
             $res = $this->removeConsecutiveChars($res);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     {
302 302
         $renderedText = $citationNumber + 1;
303 303
         $renderedText = $this->applyAdditionalMarkupFunction($data, $renderedText);
304
-        return (string)$renderedText;
304
+        return (string) $renderedText;
305 305
     }
306 306
 
307 307
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         $macro = $this->macros->get($this->renderObject);
314 314
         if (is_null($macro)) {
315 315
             try {
316
-                throw new CiteProcException("Macro \"".$this->renderObject."\" does not exist.");
316
+                throw new CiteProcException("Macro \"" . $this->renderObject . "\" does not exist.");
317 317
             } catch (CiteProcException $e) {
318 318
                 $renderedText = "";
319 319
             }
Please login to merge, or discard this patch.
src/Rendering/Name/NamePart.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
     public static function factory(SimpleXMLElement $node): NamePart
47 47
     {
48
-        $name = (string)$node['name'];
48
+        $name = (string) $node['name'];
49 49
         $stylesRenderer = StylesRenderer::factory($node);
50 50
         return new self($name, $stylesRenderer);
51 51
     }
Please login to merge, or discard this patch.
src/Rendering/Name/Names.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             }
151 151
         }
152 152
 
153
-        $variables = new ArrayList(...explode(" ", (string)$node['variable']));
153
+        $variables = new ArrayList(...explode(" ", (string) $node['variable']));
154 154
         $names->setVariables($variables);
155 155
         CiteProc::getContext()->addObserver($names);
156 156
         return $names;
@@ -369,6 +369,6 @@  discard block
 block discarded – undo
369 369
      */
370 370
     public function getNameOptions(RenderingMode $mode): NameOptions
371 371
     {
372
-        return $this->nameOptions[(string)$mode];
372
+        return $this->nameOptions[(string) $mode];
373 373
     }
374 374
 }
Please login to merge, or discard this patch.
src/Rendering/Layout.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $stylesRenderer = StylesRenderer::factory($node);
92 92
         $layout->setChildren($children);
93 93
         $layout->setStylesRenderer($stylesRenderer);
94
-        $layout->setDelimiter((string)$node->attributes()['delimiter']);
94
+        $layout->setDelimiter((string) $node->attributes()['delimiter']);
95 95
         CiteProc::getContext()->addObserver($layout);
96 96
         return $layout;
97 97
     }
@@ -117,8 +117,7 @@  discard block
 block discarded – undo
117 117
         }
118 118
 
119 119
         if ($this->mode->equals(RenderingMode::BIBLIOGRAPHY())) {
120
-            foreach ($data as $citationNumber => $item) {
121
-                ++self::$numberOfCitedItems;
120
+            foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems;
122 121
                 CiteProc::getContext()->getResults()->append(
123 122
                     $this->wrapBibEntry($item, $this->renderSingle($item, $citationNumber))
124 123
                 );
@@ -202,7 +201,7 @@  discard block
 block discarded – undo
202 201
     private function wrapBibEntry(stdClass $dataItem, string $value): string
203 202
     {
204 203
         $value = $this->stylesRenderer->renderAffixes($value);
205
-        return "\n  ".
204
+        return "\n  " .
206 205
             "<div class=\"csl-entry\">" .
207 206
             $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value) .
208 207
             "</div>";
Please login to merge, or discard this patch.