@@ -91,8 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | if (CiteProc::getContext()->isModeBibliography()) { |
| 94 | - foreach ($data as $citationNumber => $item) { |
|
| 95 | - ++self::$numberOfCitedItems; |
|
| 94 | + foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems; |
|
| 96 | 95 | CiteProc::getContext()->getResults()->append( |
| 97 | 96 | $this->wrapBibEntry($item, $this->renderSingle($item, $citationNumber)) |
| 98 | 97 | ); |
@@ -149,8 +148,8 @@ discard block |
||
| 149 | 148 | $this->htmlentities($this->format(implode("", $margin))). |
| 150 | 149 | $this->suffix |
| 151 | 150 | ); |
| 152 | - $res = '<div class="csl-left-margin">' . trim($leftMargin) . '</div>'; |
|
| 153 | - $res .= '<div class="csl-right-inline">' . trim($rightInline) . '</div>'; |
|
| 151 | + $res = '<div class="csl-left-margin">'.trim($leftMargin).'</div>'; |
|
| 152 | + $res .= '<div class="csl-right-inline">'.trim($rightInline).'</div>'; |
|
| 154 | 153 | return $res; |
| 155 | 154 | } elseif (!empty($inMargin)) { |
| 156 | 155 | $res = $this->format(implode("", $inMargin)); |
@@ -176,8 +175,8 @@ discard block |
||
| 176 | 175 | { |
| 177 | 176 | $value = $this->addAffixes($value); |
| 178 | 177 | return "\n ". |
| 179 | - "<div class=\"csl-entry\">" . |
|
| 180 | - $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value) . |
|
| 178 | + "<div class=\"csl-entry\">". |
|
| 179 | + $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value). |
|
| 181 | 180 | "</div>"; |
| 182 | 181 | } |
| 183 | 182 | |
@@ -218,7 +217,7 @@ discard block |
||
| 218 | 217 | { |
| 219 | 218 | $arr = $data->toArray(); |
| 220 | 219 | |
| 221 | - $arr_ = array_filter($arr, function ($dataItem) use ($citationItems) { |
|
| 220 | + $arr_ = array_filter($arr, function($dataItem) use ($citationItems) { |
|
| 222 | 221 | foreach ($citationItems as $citationItem) { |
| 223 | 222 | if ($dataItem->id === $citationItem->id) { |
| 224 | 223 | return true; |
@@ -32,10 +32,10 @@ |
||
| 32 | 32 | public static function createConstraint(string $name, string $value, string $match) |
| 33 | 33 | { |
| 34 | 34 | $parts = explode("-", $name); |
| 35 | - $className = implode("", array_map(function ($part) { |
|
| 36 | - return ucfirst($part);//overridden function |
|
| 35 | + $className = implode("", array_map(function($part) { |
|
| 36 | + return ucfirst($part); //overridden function |
|
| 37 | 37 | }, $parts)); |
| 38 | - $className = self::NAMESPACE_CONSTRAINTS . $className; |
|
| 38 | + $className = self::NAMESPACE_CONSTRAINTS.$className; |
|
| 39 | 39 | |
| 40 | 40 | if (!class_exists($className)) { |
| 41 | 41 | throw new ClassNotFoundException($className); |
@@ -264,17 +264,17 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | switch ($this->delimiterPrecedesEtAl) { |
| 266 | 266 | case 'never': |
| 267 | - $text = $text . " " . $this->etAl; |
|
| 267 | + $text = $text." ".$this->etAl; |
|
| 268 | 268 | break; |
| 269 | 269 | case 'always': |
| 270 | - $text = $text . $this->delimiter . $this->etAl; |
|
| 270 | + $text = $text.$this->delimiter.$this->etAl; |
|
| 271 | 271 | break; |
| 272 | 272 | case 'contextual': |
| 273 | 273 | default: |
| 274 | 274 | if (count($resultNames) === 1) { |
| 275 | - $text .= " " . $this->etAl; |
|
| 275 | + $text .= " ".$this->etAl; |
|
| 276 | 276 | } else { |
| 277 | - $text .= $this->delimiter . $this->etAl; |
|
| 277 | + $text .= $this->delimiter.$this->etAl; |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | { |
| 483 | 483 | $count = count($resultNames); |
| 484 | 484 | if (!empty($this->and) && $count > 1 && empty($this->etAl)) { |
| 485 | - $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 485 | + $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 486 | 486 | // set prefixed last name at the last position of $resultNames array |
| 487 | 487 | $resultNames[count($resultNames) - 1] = $new; |
| 488 | 488 | } |
@@ -571,9 +571,9 @@ discard block |
||
| 571 | 571 | $text = !empty($given) ? $given." ".$family : $family; |
| 572 | 572 | } |
| 573 | 573 | } elseif (StringHelper::isAsianString(NameHelper::normalizeName($data))) { |
| 574 | - $text = $this->form === "long" ? $data->family . $data->given : $data->family; |
|
| 574 | + $text = $this->form === "long" ? $data->family.$data->given : $data->family; |
|
| 575 | 575 | } else { |
| 576 | - $text = $this->form === "long" ? $data->family . " " . $data->given : $data->family; |
|
| 576 | + $text = $this->form === "long" ? $data->family." ".$data->given : $data->family; |
|
| 577 | 577 | } |
| 578 | 578 | return $text; |
| 579 | 579 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 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(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | //filter by form |
| 123 | 123 | if ($type !== "options") { |
| 124 | 124 | /** @var Term $value */ |
| 125 | - $array = array_filter($array, function ($term) use ($form) { |
|
| 125 | + $array = array_filter($array, function($term) use ($form) { |
|
| 126 | 126 | return $term->form === $form; |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | throw new CiteProcException('No valid format for variable data. Either DataList or array expected'); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - switch ((string)$mode) { |
|
| 38 | + switch ((string) $mode) { |
|
| 39 | 39 | case Config\RenderingMode::BIBLIOGRAPHY: |
| 40 | 40 | CiteProc::getContext()->setMode($mode); |
| 41 | 41 | // set CitationItems to Context |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | if (is_array($citationItems)) { |
| 47 | 47 | $citationItems = new ArrayList(...$citationItems); |
| 48 | 48 | } elseif (!($citationItems instanceof ArrayList)) { |
| 49 | - throw new CiteProcException('No valid format for variable ' . |
|
| 50 | - '`citationItems`, ' . |
|
| 49 | + throw new CiteProcException('No valid format for variable '. |
|
| 50 | + '`citationItems`, '. |
|
| 51 | 51 | 'array or ArrayList expected.'); |
| 52 | 52 | } |
| 53 | 53 | CiteProc::getContext()->setMode($mode); |
@@ -61,10 +61,10 @@ |
||
| 61 | 61 | $lastChar = mb_substr($text, -1, 1); |
| 62 | 62 | if ($closeQuote === $lastChar) { // last char is closing quote? |
| 63 | 63 | $text = mb_substr($text, 0, mb_strlen($text) - 1); //set suffix before |
| 64 | - return $text . $suffix . $lastChar; |
|
| 64 | + return $text.$suffix.$lastChar; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | - return $prefix . $text . $suffix; |
|
| 68 | + return $prefix.$text.$suffix; |
|
| 69 | 69 | } |
| 70 | 70 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | return $text; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - switch ((string)$this->textCase) { |
|
| 40 | + switch ((string) $this->textCase) { |
|
| 41 | 41 | case TextCase::UPPERCASE: |
| 42 | 42 | $text = $this->keepNoCase(mb_strtoupper($text), $text); |
| 43 | 43 | break; |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | if ($node instanceof StyleSheet) { |
| 64 | 64 | $node = ($node)(); |
| 65 | 65 | } |
| 66 | - $nodeClass = self::CITE_PROC_NODE_NAMESPACE . self::$nodes[$node->getName()]; |
|
| 66 | + $nodeClass = self::CITE_PROC_NODE_NAMESPACE.self::$nodes[$node->getName()]; |
|
| 67 | 67 | if (!class_exists($nodeClass)) { |
| 68 | 68 | throw new InvalidStylesheetException("For node {$node->getName()} ". |
| 69 | 69 | "does not exist any counterpart class \"".$nodeClass. |
@@ -29,6 +29,6 @@ |
||
| 29 | 29 | return $text; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - return sprintf("<div class=\"csl-%s\">%s</div>", (string)$this->display, $text); |
|
| 32 | + return sprintf("<div class=\"csl-%s\">%s</div>", (string) $this->display, $text); |
|
| 33 | 33 | } |
| 34 | 34 | } |