Test Failed
Push — master ( 39b140...ee05ce )
by Sebastian
09:47
created
src/Seboettg/CiteProc/Style/InheritableNameAttributesTrait.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         $parentStyleElement = null;
198 198
         if ($this instanceof  Name) {
199 199
             $parentStyleElement = ($context->isModeBibliography() ? $context->getBibliography() : $context->getCitation());
200
-        } else if ($this instanceof StyleElement){
200
+        } else if ($this instanceof StyleElement) {
201 201
             $parentStyleElement = $context->getRoot();
202 202
         }
203 203
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 case 'and':
208 208
                     $and = "";
209 209
                     if (!empty($attribute)) {
210
-                        $and = (string)$attribute;
210
+                        $and = (string) $attribute;
211 211
 
212 212
                     } else if (!empty($parentStyleElement)) { //inherit from parent style
213 213
                         $and = $parentStyleElement->getAnd();
@@ -220,14 +220,14 @@  discard block
 block discarded – undo
220 220
                     break;
221 221
                 case 'delimiter-precedes-et-al':
222 222
                     if (!empty($attribute)) {
223
-                        $this->delimiterPrecedesEtAl = (string)$attribute;
223
+                        $this->delimiterPrecedesEtAl = (string) $attribute;
224 224
                     } else if (!empty($parentStyleElement)) { //inherit from parent style
225 225
                         $this->delimiterPrecedesEtAl = $parentStyleElement->getDelimiterPrecedesEtAl();
226 226
                     }
227 227
                     break;
228 228
                 case 'delimiter-precedes-last':
229 229
                     if (!empty($attribute)) {
230
-                        $this->delimiterPrecedesLast = (string)$attribute;
230
+                        $this->delimiterPrecedesLast = (string) $attribute;
231 231
                     } else if (!empty($parentStyleElement)) { //inherit from parent style
232 232
                         $this->delimiterPrecedesLast = $parentStyleElement->getDelimiterPrecedesLast();
233 233
                     }
@@ -241,14 +241,14 @@  discard block
 block discarded – undo
241 241
                     break;
242 242
                 case 'et-al-use-first':
243 243
                     if (!empty($attribute)) {
244
-                        $this->etAlUseFirst = intval((string)$attribute);
244
+                        $this->etAlUseFirst = intval((string) $attribute);
245 245
                     } else if (!empty($parentStyleElement)) {
246 246
                         $this->etAlUseFirst = $parentStyleElement->getEtAlUseFirst();
247 247
                     }
248 248
                     break;
249 249
                 case 'et-al-subsequent-min':
250 250
                     if (!empty($attribute)) {
251
-                        $this->etAlSubsequentMin = intval((string)$attribute);
251
+                        $this->etAlSubsequentMin = intval((string) $attribute);
252 252
                     } else if (!empty($parentStyleElement)) {
253 253
                         $this->etAlSubsequentMin = $parentStyleElement->getEtAlSubsequentMin();
254 254
                     }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                     break;
279 279
                 case 'initialize-with':
280 280
                     if (!empty($attribute)) {
281
-                        $this->initializeWith = (string)$attribute;
281
+                        $this->initializeWith = (string) $attribute;
282 282
                     } else if (!empty($parentStyleElement)) {
283 283
                         $this->initializeWith = $parentStyleElement->getInitializeWith();
284 284
                     }
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
@@ -73,8 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         if (CiteProc::getContext()->isModeBibliography()) {
75 75
             if ($data instanceof DataList) {
76
-                foreach ($data as $citationNumber => $item) {
77
-                    ++self::$numberOfCitedItems;
76
+                foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems;
78 77
                     CiteProc::getContext()->getResults()->append($this->wrapBibEntry($this->renderSingle($item, $citationNumber)));
79 78
                 }
80 79
                 $ret .= implode($this->delimiter, CiteProc::getContext()->getResults()->toArray());
@@ -82,7 +81,7 @@  discard block
 block discarded – undo
82 81
                 $ret .= $this->wrapBibEntry($this->renderSingle($data, $citationNumber));
83 82
             }
84 83
 
85
-            return "<div class=\"csl-bib-body\">".$ret."\n</div>";
84
+            return "<div class=\"csl-bib-body\">" . $ret . "\n</div>";
86 85
 
87 86
         } else if (CiteProc::getContext()->isModeCitation()) {
88 87
             if (is_array($data) || $data instanceof DataList) {
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Locale/LocaleXmlParserTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     {
61 61
         /** @var \SimpleXMLElement $node */
62 62
         foreach ($locale as $node) {
63
-            switch($node->getName()) {
63
+            switch ($node->getName()) {
64 64
                 case 'style-options':
65 65
                     $this->optionsXml->add('options', $node);
66 66
                     foreach ($node->attributes() as $name => $value) {
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                     }
109 109
                     break;
110 110
                 case 'date':
111
-                    $form = (string)$node["form"];
111
+                    $form = (string) $node["form"];
112 112
                     $this->dateXml->add($form, $node);
113 113
                     foreach ($node->children() as $child) {
114 114
                         $date = new \stdClass();
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Date/Date.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         if ($this->dateParts->count() < 1 && in_array($form, self::$localizedDateFormats)) {
143 143
             if ($this->hasDatePartsFromLocales($form)) {
144 144
                 $datePartsFromLocales = $this->getDatePartsFromLocales($form);
145
-                array_filter($datePartsFromLocales, function (\SimpleXMLElement $item) use ($dateParts) {
145
+                array_filter($datePartsFromLocales, function(\SimpleXMLElement $item) use ($dateParts) {
146 146
                     return in_array($item["name"], $dateParts);
147 147
                 });
148 148
 
@@ -212,8 +212,8 @@  discard block
 block discarded – undo
212 212
                 $ret = $this->renderDateRange($toRender, $from, $to, $delim);
213 213
             }
214 214
 
215
-            if (isset($var->raw) && preg_match("/(\p{L}+)\s?([\-\-\&,])\s?(\p{L}+)/u", $var->raw, $matches)){
216
-                return $matches[1].$matches[2].$matches[3];
215
+            if (isset($var->raw) && preg_match("/(\p{L}+)\s?([\-\-\&,])\s?(\p{L}+)/u", $var->raw, $matches)) {
216
+                return $matches[1] . $matches[2] . $matches[3];
217 217
             }
218 218
         }
219 219
         // fallback:
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         $data = [];
243 243
         foreach ($dates as $date) {
244 244
             if ($date[0] < 1000) {
245
-                $dateTime = new DateTime(0,0,0);
245
+                $dateTime = new DateTime(0, 0, 0);
246 246
                 $dateTime->setDay(0)->setMonth(0)->setYear(0);
247 247
                 $data[] = $dateTime;
248 248
             }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
                 $dp = $this->dateParts->toArray();
348 348
                 $i = 0;
349 349
                 $dateParts_ = [];
350
-                array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
350
+                array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
351 351
                     if (strpos($key, "year") !== false || strpos($key, "month") !== false) {
352 352
                         $dateParts_["yearmonth"][] = $datePart;
353 353
                     }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 $dp = $this->dateParts->toArray();
361 361
                 $i = 0;
362 362
                 $dateParts_ = [];
363
-                array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
363
+                array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
364 364
                     if (strpos($key, "year") !== false || strpos($key, "day") !== false) {
365 365
                         $dateParts_["yearday"][] = $datePart;
366 366
                     }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
                 $dp = $this->dateParts->toArray();
374 374
                 $i = 0;
375 375
                 $dateParts_ = [];
376
-                array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
376
+                array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) {
377 377
                     //$bit = sprintf("%03d", decbin($differentParts));
378 378
                     if (strpos($key, "month") !== false || strpos($key, "day") !== false) {
379 379
                         $dateParts_["monthday"][] = $datePart;
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         $from = $datePart->renderWithoutAffixes($from, $this);
424 424
         $to = $datePart->renderWithoutAffixes($to, $this);
425 425
         $suffix = !empty($to) ? $datePart->renderSuffix() : "";
426
-        return $prefix.$from.$delim.$to.$suffix;
426
+        return $prefix . $from . $delim . $to . $suffix;
427 427
     }
428 428
 
429 429
     /**
@@ -448,9 +448,9 @@  discard block
 block discarded – undo
448 448
         // no custom date parts within the date element (this)?
449 449
         if (!empty($dateFromLocale)) {
450 450
 
451
-            $dateForm = array_filter(is_array($dateFromLocale) ? $dateFromLocale : [$dateFromLocale], function ($element) use ($format) {
451
+            $dateForm = array_filter(is_array($dateFromLocale) ? $dateFromLocale : [$dateFromLocale], function($element) use ($format) {
452 452
                 /** @var \SimpleXMLElement $element */
453
-                $dateForm = (string)$element->attributes()["form"];
453
+                $dateForm = (string) $element->attributes()["form"];
454 454
                 return $dateForm === $format;
455 455
             });
456 456
 
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Number.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                     $num2 = Util\Number::dec2roman($matches[3]);
100 100
                     $text = $this->buildNumberRangeString($num1, $num2, $matches[2]);
101 101
                 } else {
102
-                    $text =  Util\Number::dec2roman($var);
102
+                    $text = Util\Number::dec2roman($var);
103 103
                 }
104 104
                 break;
105 105
             case 'numeric':
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 if (preg_match("/\s*(\d+)\s*([\-\-\&,])\s*(\d+)\s*/", $var, $matches)) {
115 115
                     $text = $this->buildNumberRangeString($matches[1], $matches[3], $matches[2]);
116 116
                 } else {
117
-                    $text =  Util\Number::dec2roman($var);
117
+                    $text = Util\Number::dec2roman($var);
118 118
                 }
119 119
                 break;
120 120
         }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $numRange = "$num1 " . htmlentities(self::RANGE_DELIMITER_AMPERSAND) . " $num2";
159 159
         } else if (self::RANGE_DELIMITER_COMMA === $delim) {
160 160
             $numRange = $num1 . htmlentities(self::RANGE_DELIMITER_COMMA) . " $num2";
161
-        } else  {
161
+        } else {
162 162
             $numRange = $num1 . self::RANGE_DELIMITER_HYPHEN . $num2;
163 163
         }
164 164
         return $numRange;
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
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
 
122 122
         $count = 0;
123 123
 
124
-        $hasPreceding = CiteProc::getContext()->getCitationItems()->hasKey($citationNumber-1);
124
+        $hasPreceding = CiteProc::getContext()->getCitationItems()->hasKey($citationNumber - 1);
125 125
         if ($hasPreceding) {
126 126
             /** @var \stdClass $preceding */
127
-            $preceding = CiteProc::getContext()->getCitationItems()->get($citationNumber-1);
127
+            $preceding = CiteProc::getContext()->getCitationItems()->get($citationNumber - 1);
128 128
         }
129 129
 
130 130
         $subsequentSubstitution = CiteProc::getContext()->getCitationItems()->getSubsequentAuthorSubstitute();
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         which allows for advanced sorting. */
192 192
 
193 193
         if ($this->form == 'count') {
194
-            return (int)count($resultNames);
194
+            return (int) count($resultNames);
195 195
         }
196 196
 
197 197
         return $text;
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
         if (count($this->nameParts) > 0) {
217 217
             /** @var NamePart $namePart */
218 218
             foreach ($this->nameParts as $namePart) {
219
-                $nameObj->{$namePart->getName()} =   $namePart->render($name);
219
+                $nameObj->{$namePart->getName()} = $namePart->render($name);
220 220
             }
221 221
         }
222 222
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
                         //remove last comma when no suffix exist.
268 268
                         $text = trim($text);
269
-                        $text = substr($text, -1) === "," ? substr($text, 0, strlen($text)-1) : $text;
269
+                        $text = substr($text, -1) === "," ? substr($text, 0, strlen($text) - 1) : $text;
270 270
                         break;
271 271
                     default:
272 272
                         /*
Please login to merge, or discard this patch.