@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | $number = $data->{$this->variable}; |
101 | 101 | $decimalNumber = $this->toDecimalNumber($number); |
102 | - switch ((string)$this->form) { |
|
102 | + switch ((string) $this->form) { |
|
103 | 103 | case Form::ORDINAL: |
104 | 104 | if (preg_match(self::PATTERN_ORDINAL, $decimalNumber, $matches)) { |
105 | 105 | $num1 = $this->ordinal($matches[1]); |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | { |
206 | 206 | |
207 | 207 | if (self::RANGE_DELIMITER_AMPERSAND === $delimiter) { |
208 | - $numRange = "$num1 ".htmlentities(self::RANGE_DELIMITER_AMPERSAND)." $num2"; |
|
208 | + $numRange = "$num1 " . htmlentities(self::RANGE_DELIMITER_AMPERSAND) . " $num2"; |
|
209 | 209 | } else { |
210 | 210 | if (self::RANGE_DELIMITER_COMMA === $delimiter) { |
211 | - $numRange = $num1.htmlentities(self::RANGE_DELIMITER_COMMA)." $num2"; |
|
211 | + $numRange = $num1 . htmlentities(self::RANGE_DELIMITER_COMMA) . " $num2"; |
|
212 | 212 | } else { |
213 | - $numRange = $num1.self::RANGE_DELIMITER_HYPHEN.$num2; |
|
213 | + $numRange = $num1 . self::RANGE_DELIMITER_HYPHEN . $num2; |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | return $numRange; |
@@ -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; |
@@ -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 |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | public static function appendParticleTo(&$data, $namePart, $particle) |
71 | 71 | { |
72 | 72 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
73 | - $data->{$namePart} = $data->{$namePart}." ".$data->{$particle}; // append $particle to $namePart |
|
73 | + $data->{$namePart} = $data->{$namePart} . " " . $data->{$particle}; // append $particle to $namePart |
|
74 | 74 | unset($data->{$particle}); //remove particle from $data |
75 | 75 | } |
76 | 76 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | public static function prependParticleTo(&$data, $namePart, $particle) |
85 | 85 | { |
86 | 86 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
87 | - $data->{$namePart} = $data->{$particle}." ".$data->{$namePart}; //prepend $particle to $namePart |
|
87 | + $data->{$namePart} = $data->{$particle} . " " . $data->{$namePart}; //prepend $particle to $namePart |
|
88 | 88 | unset($data->{$particle}); //remove particle from $data |
89 | 89 | } |
90 | 90 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if (empty($data->family)) { |
122 | 122 | throw new CiteProcException("Illegal argument. Name has no family name."); |
123 | 123 | } |
124 | - return $data->family.(isset($data->given) ? $data->given : ""); |
|
124 | + return $data->family . (isset($data->given) ? $data->given : ""); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | public static function addExtendedMarkup($nameVar, $nameItem, $formattedName) |
@@ -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 | } |