@@ -53,12 +53,12 @@ |
||
| 53 | 53 | */ |
| 54 | 54 | public function __construct(Config\Locale $localeConfig, $xmlString = null) |
| 55 | 55 | { |
| 56 | - $this->language = (string)$localeConfig; |
|
| 56 | + $this->language = (string) $localeConfig; |
|
| 57 | 57 | |
| 58 | 58 | if (!empty($xmlString)) { |
| 59 | 59 | $this->localeXml = new SimpleXMLElement($xmlString); |
| 60 | 60 | } else { |
| 61 | - $this->localeXml = new SimpleXMLElement(loadLocales((string)$localeConfig)); |
|
| 61 | + $this->localeXml = new SimpleXMLElement(loadLocales((string) $localeConfig)); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | $this->initLocaleXmlParser(); |
@@ -92,7 +92,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -68,7 +68,7 @@ |
||
| 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 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $stylesRenderer = StylesRenderer::factory($node); |
| 74 | 74 | $layout->setChildren($children); |
| 75 | 75 | $layout->setStylesRenderer($stylesRenderer); |
| 76 | - $layout->setDelimiter((string)$node->attributes()['delimiter']); |
|
| 76 | + $layout->setDelimiter((string) $node->attributes()['delimiter']); |
|
| 77 | 77 | return $layout; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -98,15 +98,14 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | if (CiteProc::getContext()->isModeBibliography()) { |
| 101 | - foreach ($data as $citationNumber => $item) { |
|
| 102 | - ++self::$numberOfCitedItems; |
|
| 101 | + foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems; |
|
| 103 | 102 | CiteProc::getContext()->getResults()->append( |
| 104 | 103 | $this->wrapBibEntry($item, $this->renderSingle($item, $citationNumber)) |
| 105 | 104 | ); |
| 106 | 105 | } |
| 107 | 106 | $ret .= implode($this->delimiter, CiteProc::getContext()->getResults()->toArray()); |
| 108 | 107 | $ret = StringHelper::clearApostrophes($ret); |
| 109 | - return "<div class=\"csl-bib-body\">".$ret."\n</div>"; |
|
| 108 | + return "<div class=\"csl-bib-body\">" . $ret . "\n</div>"; |
|
| 110 | 109 | } elseif (CiteProc::getContext()->isModeCitation()) { |
| 111 | 110 | if ($citationItems->count() > 0) { //is there a filter for specific citations? |
| 112 | 111 | if ($this->isGroupedCitations($citationItems)) { //if citation items grouped? |
@@ -184,7 +183,7 @@ discard block |
||
| 184 | 183 | private function wrapBibEntry($dataItem, $value): string |
| 185 | 184 | { |
| 186 | 185 | $value = $this->stylesRenderer->renderAffixes($value); |
| 187 | - return "\n ". |
|
| 186 | + return "\n " . |
|
| 188 | 187 | "<div class=\"csl-entry\">" . |
| 189 | 188 | $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value) . |
| 190 | 189 | "</div>"; |
@@ -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 | } |