@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $dp = $dateParts->toArray(); |
30 | 30 | $dateParts_ = []; |
31 | - array_walk($dp, function ($datePart, $key) use (&$dateParts_) { |
|
31 | + array_walk($dp, function($datePart, $key) use (&$dateParts_) { |
|
32 | 32 | //$bit = sprintf("%03d", decbin($differentParts)); |
33 | 33 | if (strpos($key, "month") !== false || strpos($key, "day") !== false) { |
34 | 34 | $dateParts_["monthday"][] = $datePart; |
@@ -151,7 +151,7 @@ |
||
151 | 151 | public function flatten($array) |
152 | 152 | { |
153 | 153 | $returnArray = []; |
154 | - array_walk_recursive($array, function ($a) use (&$returnArray) { |
|
154 | + array_walk_recursive($array, function($a) use (&$returnArray) { |
|
155 | 155 | $returnArray[] = $a; |
156 | 156 | }); |
157 | 157 | return $returnArray; |
@@ -118,7 +118,7 @@ |
||
118 | 118 | //filter by form |
119 | 119 | if ($type !== "options") { |
120 | 120 | /** @var Term $value */ |
121 | - $array = array_filter($array, function ($term) use ($form) { |
|
121 | + $array = array_filter($array, function($term) use ($form) { |
|
122 | 122 | return $term->form === $form; |
123 | 123 | }); |
124 | 124 | } |
@@ -91,21 +91,21 @@ |
||
91 | 91 | $style = StyleSheet::loadStyleSheet("ieee"); |
92 | 92 | $citeProc = new CiteProc($style, "en-US", [ |
93 | 93 | "bibliography" => [ |
94 | - "author" => function ($authorItem, $renderedText) { |
|
94 | + "author" => function($authorItem, $renderedText) { |
|
95 | 95 | if (isset($authorItem->id)) { |
96 | 96 | return '<a href="https://example.org/author/'.$authorItem->id.'">'.$renderedText.'</a>'; |
97 | 97 | } |
98 | 98 | return $renderedText; |
99 | 99 | }, |
100 | - "title" => function ($cslItem, $renderedText) { |
|
100 | + "title" => function($cslItem, $renderedText) { |
|
101 | 101 | return '<a href="https://example.org/publication/'.$cslItem->id.'">'.$renderedText.'</a>'; |
102 | 102 | }, |
103 | - "csl-entry" => function ($cslItem, $renderedText) { |
|
103 | + "csl-entry" => function($cslItem, $renderedText) { |
|
104 | 104 | return '<a id="'.$cslItem->id.'" href="#'.$cslItem->id.'"></a>'.$renderedText; |
105 | 105 | } |
106 | 106 | ], |
107 | 107 | "citation" => [ |
108 | - "citation-number" => function ($cslItem, $renderedText) { |
|
108 | + "citation-number" => function($cslItem, $renderedText) { |
|
109 | 109 | return '<a href="#'.$cslItem->id.'">'.$renderedText.'</a>'; |
110 | 110 | } |
111 | 111 | ] |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | $str .= $this->label->render($data); |
197 | 197 | } |
198 | 198 | $vars = $this->variables->toArray(); |
199 | - $vars = array_filter($vars, function ($value) { |
|
199 | + $vars = array_filter($vars, function($value) { |
|
200 | 200 | return !($value === "editor" || $value === "translator"); |
201 | 201 | }); |
202 | 202 | $this->variables->setArray($vars); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | |
378 | 378 | private function filterEmpty(array $results) |
379 | 379 | { |
380 | - return array_filter($results, function ($item) { |
|
380 | + return array_filter($results, function($item) { |
|
381 | 381 | return !empty($item); |
382 | 382 | }); |
383 | 383 | } |
@@ -267,17 +267,17 @@ discard block |
||
267 | 267 | |
268 | 268 | switch ($this->delimiterPrecedesEtAl) { |
269 | 269 | case 'never': |
270 | - $text = $text . " " . $this->etAl; |
|
270 | + $text = $text." ".$this->etAl; |
|
271 | 271 | break; |
272 | 272 | case 'always': |
273 | - $text = $text . $this->delimiter . $this->etAl; |
|
273 | + $text = $text.$this->delimiter.$this->etAl; |
|
274 | 274 | break; |
275 | 275 | case 'contextual': |
276 | 276 | default: |
277 | 277 | if (count($resultNames) === 1) { |
278 | - $text .= " " . $this->etAl; |
|
278 | + $text .= " ".$this->etAl; |
|
279 | 279 | } else { |
280 | - $text .= $this->delimiter . $this->etAl; |
|
280 | + $text .= $this->delimiter.$this->etAl; |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | } |
@@ -574,9 +574,9 @@ discard block |
||
574 | 574 | $text = !empty($given) ? $given." ".$family : $family; |
575 | 575 | } |
576 | 576 | } elseif (StringHelper::isAsianString(NameHelper::normalizeName($data))) { |
577 | - $text = $this->form === "long" ? $data->family . $data->given : $data->family; |
|
577 | + $text = $this->form === "long" ? $data->family.$data->given : $data->family; |
|
578 | 578 | } else { |
579 | - $text = $this->form === "long" ? $data->family . " " . $data->given : $data->family; |
|
579 | + $text = $this->form === "long" ? $data->family." ".$data->given : $data->family; |
|
580 | 580 | } |
581 | 581 | return $text; |
582 | 582 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $resultNames[] = $this->formatName($name, $rank); |
358 | 358 | } |
359 | 359 | break; |
360 | - /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
360 | + /* “partial-first” - as “partial-each”, but substitution is limited to the first name of the name |
|
361 | 361 | variable. */ |
362 | 362 | case SubsequentAuthorSubstituteRule::PARTIAL_FIRST: |
363 | 363 | if ($rank === 0) { |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | } |
372 | 372 | break; |
373 | 373 | |
374 | - /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
374 | + /* “complete-each” - requires a complete match like “complete-all”, but now the value of |
|
375 | 375 | subsequent-author-substitute substitutes for each rendered name. */ |
376 | 376 | case SubsequentAuthorSubstituteRule::COMPLETE_EACH: |
377 | 377 | try { |
@@ -310,7 +310,7 @@ |
||
310 | 310 | return false; |
311 | 311 | } |
312 | 312 | |
313 | - array_walk($persons1, function ($name, $key) use ($persons2, &$same) { |
|
313 | + array_walk($persons1, function($name, $key) use ($persons2, &$same) { |
|
314 | 314 | $family1 = $name->family; |
315 | 315 | $family2 = $persons2[$key]->family; |
316 | 316 | $same = $same && ($family1 === $family2); |
@@ -430,7 +430,7 @@ |
||
430 | 430 | |
431 | 431 | public function getCitationItemById($id) |
432 | 432 | { |
433 | - return $this->citationItems->filter(function ($item) use ($id) { |
|
433 | + return $this->citationItems->filter(function($item) use ($id) { |
|
434 | 434 | return $item->id === $id; |
435 | 435 | })->current(); |
436 | 436 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public static function mapLocatorLabelToRenderVariable($locatorTerm) |
40 | 40 | { |
41 | 41 | if ($locatorTerm instanceof Locator) { |
42 | - $locatorTerm = (string)$locatorTerm; |
|
42 | + $locatorTerm = (string) $locatorTerm; |
|
43 | 43 | } |
44 | 44 | return |
45 | 45 | array_key_exists($locatorTerm, self::LABEL_TO_VARIABLE_MAP) ? |