Completed
Push — master ( 3eefa2...fea31f )
by Sebastian
03:06
created
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/Util/StringHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $wordArray = explode(" ", $text);
66 66
 
67
-        array_walk($wordArray, function (&$word) {
67
+        array_walk($wordArray, function(&$word) {
68 68
             $word = ucfirst($word);
69 69
         });
70 70
 
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
     public static function capitalizeForTitle($titleString)
75 75
     {
76 76
         if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) {
77
-            $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3];
77
+            $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3];
78 78
         }
79 79
 
80 80
         $wordArray = explode(" ", $titleString);
81 81
 
82
-        array_walk($wordArray, function (&$word) {
82
+        array_walk($wordArray, function(&$word) {
83 83
 
84 84
             $words = explode("-", $word);
85 85
             if (count($words) > 1) {
86
-                array_walk($words, function (&$w) {
86
+                array_walk($words, function(&$w) {
87 87
                     $w = StringHelper::keepLowerCase($w) ? $w : StringHelper::mb_ucfirst($w);
88 88
                 });
89 89
                 $word = implode("-", $words);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
     public static function keepLowerCase($word)
98 98
     {
99
-        $lowerCase =  in_array($word, self::PREPOSITIONS) ||
99
+        $lowerCase = in_array($word, self::PREPOSITIONS) ||
100 100
             in_array($word, self::ARTICLES) ||
101 101
             in_array($word, self::CONJUNCTIONS) ||
102 102
             in_array($word, self::ADJECTIVES);
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Rendering/Choose/ChooseIf.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 
48 48
         foreach ($node->attributes() as $name => $value) {
49 49
             if ('match' !== $name) {
50
-                $this->constraints->append(Factory::createConstraint((string)$name, (string)$value));
50
+                $this->constraints->append(Factory::createConstraint((string) $name, (string) $value));
51 51
             }
52 52
         }
53 53
 
Please login to merge, or discard this patch.
src/Seboettg/CiteProc/Style/Sort/Sort.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,11 +101,11 @@
 block discarded – undo
101 101
             } else if ($key->isDateVariable()) {
102 102
                 $groupedItems[Date::serializeDate($dataItem->{$variable})][] = $dataItem;
103 103
                 continue;
104
-            } else if ($key->isMacro()){
104
+            } else if ($key->isMacro()) {
105 105
                 $macroResult = CiteProc::getContext()->getMacro($key->getMacro())->render($dataItem, $citationNumber);
106 106
                 $groupedItems[mb_strtolower($macroResult)] = $dataItem;
107 107
                 continue;
108
-            }  else if ($variable === "citation-number"){
108
+            } else if ($variable === "citation-number") {
109 109
                 $groupedItems[$citationNumber + 1] = $dataItem;
110 110
             } else { //this imply sort key citation-number
111 111
                 $groupedItems[mb_strtolower($dataItem->{$variable})] = $dataItem;
Please login to merge, or discard this patch.