@@ -45,7 +45,7 @@ |
||
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(); |
@@ -191,15 +191,15 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -199,49 +199,49 @@ |
||
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 | } |
@@ -45,7 +45,7 @@ |
||
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 | } |
@@ -150,7 +150,7 @@ discard block |
||
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 |
||
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 | } |
@@ -91,7 +91,7 @@ discard block |
||
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 |
||
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 |
||
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>"; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | '`citationItems`, ' . |
42 | 42 | 'array or ArrayList expected.'); |
43 | 43 | } |
44 | - switch ((string)$mode) { |
|
44 | + switch ((string) $mode) { |
|
45 | 45 | case Config\RenderingMode::BIBLIOGRAPHY: |
46 | 46 | CiteProc::getContext()->setMode($mode); |
47 | 47 | // set CitationItems to Context |
@@ -234,12 +234,12 @@ |
||
234 | 234 | |
235 | 235 | public function setSorting(RenderingMode $mode, $sorting) |
236 | 236 | { |
237 | - $this->sorting[(string)$mode] = $sorting; |
|
237 | + $this->sorting[(string) $mode] = $sorting; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | public function getSorting() |
241 | 241 | { |
242 | - return $this->sorting[(string)$this->mode] ?? null; |
|
242 | + return $this->sorting[(string) $this->mode] ?? null; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | if ($this->variable === "editortranslator") { |
118 | 118 | if (isset($data->editor) && isset($data->translator)) { |
119 | 119 | $plural = $this->getPlural($data, $plural, "editortranslator"); |
120 | - $term = $this->locale->filter('terms', "editortranslator", (string)$form); |
|
120 | + $term = $this->locale->filter('terms', "editortranslator", (string) $form); |
|
121 | 121 | $pluralForm = $term->{$plural}; |
122 | 122 | if (!empty($pluralForm)) { |
123 | 123 | $text = $pluralForm; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | })->current(); |
131 | 131 | if (!empty($citationItem->label)) { |
132 | 132 | $plural = $this->evaluateStringPluralism($citationItem->locator, $citationItem->label); |
133 | - $term = $this->locale->filter('terms', $citationItem->label, (string)$form); |
|
133 | + $term = $this->locale->filter('terms', $citationItem->label, (string) $form); |
|
134 | 134 | $pluralForm = $term->{$plural} ?? ""; |
135 | 135 | if (!empty($citationItem->locator) && !empty($pluralForm)) { |
136 | 136 | $text = $pluralForm; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | foreach ($variables as $variable) { |
141 | 141 | if (isset($data->{$variable})) { |
142 | 142 | $plural = $this->getPlural($data, $plural, $variable); |
143 | - $term = $this->locale->filter('terms', $variable, (string)$form); |
|
143 | + $term = $this->locale->filter('terms', $variable, (string) $form); |
|
144 | 144 | $pluralForm = $term->{$plural} ?? ""; |
145 | 145 | if (!empty($data->{$variable}) && !empty($pluralForm)) { |
146 | 146 | $text = $pluralForm; |