@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $lang = (isset($data->language) && $data->language != 'en') ? $data->language : 'en'; |
137 | 137 | $this->stylesRenderer->getTextCase()->setLanguage($lang); |
138 | 138 | $renderedText = ""; |
139 | - switch ((string)$this->renderType) { |
|
139 | + switch ((string) $this->renderType) { |
|
140 | 140 | case RenderType::VALUE: |
141 | 141 | $renderedText = $this->stylesRenderer->renderTextCase($this->renderObject); |
142 | 142 | break; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | private function normalizeDateRange($page) |
229 | 229 | { |
230 | 230 | if (preg_match("/^(\d+)\s?--?\s?(\d+)$/", trim($page), $matches)) { |
231 | - return $matches[1]."-".$matches[2]; |
|
231 | + return $matches[1] . "-" . $matches[2]; |
|
232 | 232 | } |
233 | 233 | return $page; |
234 | 234 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | } |
274 | 274 | return $this->stylesRenderer->renderTextCase( |
275 | 275 | StringHelper::clearApostrophes( |
276 | - htmlspecialchars((string)$value, ENT_HTML5) |
|
276 | + htmlspecialchars((string) $value, ENT_HTML5) |
|
277 | 277 | ) |
278 | 278 | ); |
279 | 279 | } |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | */ |
285 | 285 | private function formatRenderedText($renderedText) |
286 | 286 | { |
287 | - $text = $this->stylesRenderer->renderFormatting((string)$renderedText); |
|
287 | + $text = $this->stylesRenderer->renderFormatting((string) $renderedText); |
|
288 | 288 | $res = $this->stylesRenderer->renderAffixes($text); |
289 | 289 | if (!empty($res)) { |
290 | 290 | $res = $this->removeConsecutiveChars($res); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | $macro = $this->macros->get($this->renderObject); |
315 | 315 | if (is_null($macro)) { |
316 | 316 | try { |
317 | - throw new CiteProcException("Macro \"".$this->renderObject."\" does not exist."); |
|
317 | + throw new CiteProcException("Macro \"" . $this->renderObject . "\" does not exist."); |
|
318 | 318 | } catch (CiteProcException $e) { |
319 | 319 | $renderedText = ""; |
320 | 320 | } |
@@ -35,7 +35,7 @@ |
||
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 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | $digitFrom = $from[$i]; |
69 | 69 | if ($digitTo !== $digitFrom) { |
70 | - $resTo = $digitTo.$resTo; |
|
70 | + $resTo = $digitTo . $resTo; |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | return $resTo; |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | private static function renderChicago($from, $to) |
79 | 79 | { |
80 | 80 | if ($from > 100 && ($from % 100 > 0) && intval(($from / 100), 10) === intval(($to / 100), 10)) { |
81 | - return "".($to % 100); |
|
81 | + return "" . ($to % 100); |
|
82 | 82 | } elseif ($from >= 10000) { |
83 | - return "".($to % 1000); |
|
83 | + return "" . ($to % 1000); |
|
84 | 84 | } |
85 | 85 | return $to; |
86 | 86 | } |
@@ -69,8 +69,8 @@ |
||
69 | 69 | } |
70 | 70 | $nodeClass = self::CITE_PROC_NODE_NAMESPACE . self::$nodes[$node->getName()]; |
71 | 71 | if (!class_exists($nodeClass)) { |
72 | - throw new InvalidStylesheetException("For node {$node->getName()} ". |
|
73 | - "does not exist any counterpart class \"".$nodeClass. |
|
72 | + throw new InvalidStylesheetException("For node {$node->getName()} " . |
|
73 | + "does not exist any counterpart class \"" . $nodeClass . |
|
74 | 74 | "\". The given stylesheet seems to be invalid."); |
75 | 75 | } |
76 | 76 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $dateTime = new DateTime($date->{'raw'}); |
60 | 60 | $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]]; |
61 | 61 | } catch (Exception $e) { |
62 | - throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e); |
|
62 | + throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $arr; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } elseif ($match === "any" && count($dateParts) === 2) { |
112 | 112 | return true; |
113 | 113 | } else { |
114 | - $ret = ($match === "all") ? $ret&true : $ret|true; |
|
114 | + $ret = ($match === "all") ? $ret & true : $ret | true; |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | return (bool) $ret; |
@@ -169,7 +169,7 @@ |
||
169 | 169 | $parent = null; |
170 | 170 | $names = new Names( |
171 | 171 | new SimpleXMLElement( |
172 | - "<names variable=\"$variable\" delimiter=\"-\">". |
|
172 | + "<names variable=\"$variable\" delimiter=\"-\">" . |
|
173 | 173 | "<name form=\"long\" sort-separator=\",\" name-as-sort-order=\"all\"/></names>" |
174 | 174 | ), |
175 | 175 | $parent |
@@ -75,14 +75,14 @@ |
||
75 | 75 | { |
76 | 76 | $data = null; |
77 | 77 | $localesPath = vendorPath() . "/citation-style-language/locales/"; |
78 | - $localeFile = $localesPath."locales-".$langKey.'.xml'; |
|
78 | + $localeFile = $localesPath . "locales-" . $langKey . '.xml'; |
|
79 | 79 | if (file_exists($localeFile)) { |
80 | 80 | $data = file_get_contents($localeFile); |
81 | 81 | } else { |
82 | 82 | $metadata = loadLocalesMetadata(); |
83 | 83 | if (!empty($metadata->{'primary-dialects'}->{$langKey})) { |
84 | 84 | $data = file_get_contents( |
85 | - $localesPath."locales-".$metadata->{'primary-dialects'}->{$langKey}.'.xml' |
|
85 | + $localesPath . "locales-" . $metadata->{'primary-dialects'}->{$langKey} . '.xml' |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | { |
34 | 34 | $parts = explode("-", $name); |
35 | 35 | $className = implode("", array_map(function ($part) { |
36 | - return ucfirst($part);//overridden function |
|
36 | + return ucfirst($part); //overridden function |
|
37 | 37 | }, $parts)); |
38 | 38 | $className = self::NAMESPACE_CONSTRAINTS . $className; |
39 | 39 |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | } else { |
184 | 184 | $arr = []; |
185 | 185 | foreach ($data->editor as $editor) { |
186 | - $edt = $this->format($editor->family.", ".$editor->given); |
|
186 | + $edt = $this->format($editor->family . ", " . $editor->given); |
|
187 | 187 | $results[] = NameHelper::addExtendedMarkup('editor', $editor, $edt); |
188 | 188 | } |
189 | 189 | $str .= implode($this->delimiter, $arr); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | } else { |
219 | 219 | foreach ($data->{$var} as $name) { |
220 | - $formatted = $this->format($name->given." ".$name->family); |
|
220 | + $formatted = $this->format($name->given . " " . $name->family); |
|
221 | 221 | $results[] = NameHelper::addExtendedMarkup($var, $name, $formatted); |
222 | 222 | } |
223 | 223 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | { |
248 | 248 | $this->label->setVariable($var); |
249 | 249 | if (in_array($this->label->getForm(), ["verb", "verb-short"])) { |
250 | - $name = $this->label->render($data).$name; |
|
250 | + $name = $this->label->render($data) . $name; |
|
251 | 251 | } else { |
252 | 252 | $name .= $this->label->render($data); |
253 | 253 | } |