@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | $number = $data->{$this->variable}; |
136 | 136 | $decimalNumber = $this->toDecimalNumber($number); |
137 | - switch ((string)$this->form) { |
|
137 | + switch ((string) $this->form) { |
|
138 | 138 | case Form::ORDINAL: |
139 | 139 | if (preg_match(self::PATTERN_ORDINAL, $decimalNumber, $matches)) { |
140 | 140 | $num1 = $this->ordinal($matches[1]); |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | if (empty($ordinalSuffix)) { |
214 | 214 | $ordinalSuffix = $this->locale->filter('terms', 'ordinal')->single; |
215 | 215 | } |
216 | - return $num . $ordinalSuffix; |
|
216 | + return $num.$ordinalSuffix; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function longOrdinal($num) |
224 | 224 | { |
225 | 225 | $num = sprintf("%02d", $num); |
226 | - $ret = $this->locale->filter('terms', 'long-ordinal-' . $num)->single; |
|
226 | + $ret = $this->locale->filter('terms', 'long-ordinal-'.$num)->single; |
|
227 | 227 | if (!$ret) { |
228 | 228 | return $this->ordinal($num); |
229 | 229 | } |
@@ -35,19 +35,19 @@ |
||
35 | 35 | $name = $attribute->getName(); |
36 | 36 | switch ($name) { |
37 | 37 | case 'prefix': |
38 | - $prefix = (string)$attribute; |
|
38 | + $prefix = (string) $attribute; |
|
39 | 39 | break; |
40 | 40 | case 'suffix': |
41 | - $suffix = (string)$attribute; |
|
41 | + $suffix = (string) $attribute; |
|
42 | 42 | break; |
43 | 43 | case 'text-case': |
44 | - $textCase = new TextCase((string)$attribute); |
|
44 | + $textCase = new TextCase((string) $attribute); |
|
45 | 45 | break; |
46 | 46 | case 'display': |
47 | - $display = new Display((string)$attribute); |
|
47 | + $display = new Display((string) $attribute); |
|
48 | 48 | break; |
49 | 49 | case 'quotes': |
50 | - $quotes = "true" === (string)$attribute; |
|
50 | + $quotes = "true" === (string) $attribute; |
|
51 | 51 | break; |
52 | 52 | default: |
53 | 53 | if (in_array($attribute->getName(), $formattingAttributes)) { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $firstChar = substr($string, 0, 1); |
24 | 24 | $firstCharUpper = strtr($firstChar, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
25 | - return $firstCharUpper . substr($string, 1); |
|
25 | + return $firstCharUpper.substr($string, 1); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function vendorPath(): string |
33 | 33 | { |
34 | - include_once realpath(__DIR__ . '/../') . '/vendorPath.php'; |
|
34 | + include_once realpath(__DIR__.'/../').'/vendorPath.php'; |
|
35 | 35 | if (!($vendorPath = \vendorPath())) { |
36 | 36 | // @codeCoverageIgnoreStart |
37 | 37 | throw new CiteProcException('Vendor path not found. Use composer to initialize your project'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function loadStyleSheet(string $styleName) |
55 | 55 | { |
56 | - $stylesPath = vendorPath() . "/citation-style-language/styles-distribution"; |
|
56 | + $stylesPath = vendorPath()."/citation-style-language/styles-distribution"; |
|
57 | 57 | $fileName = sprintf('%s/%s.csl', $stylesPath, $styleName); |
58 | 58 | if (!file_exists($fileName)) { |
59 | 59 | throw new CiteProcException(sprintf('Stylesheet "%s" not found', $fileName)); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | function loadLocales(string $langKey) |
75 | 75 | { |
76 | 76 | $data = null; |
77 | - $localesPath = vendorPath() . "/citation-style-language/locales/"; |
|
77 | + $localesPath = vendorPath()."/citation-style-language/locales/"; |
|
78 | 78 | $localeFile = $localesPath."locales-".$langKey.'.xml'; |
79 | 79 | if (file_exists($localeFile)) { |
80 | 80 | $data = file_get_contents($localeFile); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | function loadLocalesMetadata() |
97 | 97 | { |
98 | - $localesMetadataPath = vendorPath() . "/citation-style-language/locales/locales.json"; |
|
98 | + $localesMetadataPath = vendorPath()."/citation-style-language/locales/locales.json"; |
|
99 | 99 | return json_decode(file_get_contents($localesMetadataPath)); |
100 | 100 | } |
101 | 101 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | function getCurrentById(ArrayListInterface $list, $id) |
108 | 108 | { |
109 | - return $list->filter(function ($item) use ($id) { |
|
109 | + return $list->filter(function($item) use ($id) { |
|
110 | 110 | return $item->id === $id; |
111 | 111 | })->current(); |
112 | 112 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $lang = (isset($data->language) && $data->language != 'en') ? $data->language : 'en'; |
136 | 136 | $this->stylesRenderer->getTextCase()->setLanguage($lang); |
137 | 137 | $renderedText = ""; |
138 | - switch ((string)$this->renderType) { |
|
138 | + switch ((string) $this->renderType) { |
|
139 | 139 | case RenderType::VALUE: |
140 | 140 | $renderedText = $this->stylesRenderer->renderTextCase($this->renderObject); |
141 | 141 | break; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | ); |
203 | 203 | } |
204 | 204 | list($from, $to) = $ranges; |
205 | - return $from . "–" . $to; |
|
205 | + return $from."–".$to; |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | return $page; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | // test case group_ShortOutputOnly.json |
253 | 253 | $value = ""; |
254 | 254 | if (in_array($this->form, ["short", "long"])) { |
255 | - $attrWithPrefix = $this->form . ucfirst($this->renderObject); |
|
255 | + $attrWithPrefix = $this->form.ucfirst($this->renderObject); |
|
256 | 256 | $attrWithSuffix = sprintf("%s-%s", $this->renderObject, $this->form); |
257 | 257 | if (isset($data->{$attrWithPrefix}) && !empty($data->{$attrWithPrefix})) { |
258 | 258 | $value = $data->{$attrWithPrefix}; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | } |
273 | 273 | return $this->stylesRenderer->renderTextCase( |
274 | 274 | StringHelper::clearApostrophes( |
275 | - htmlspecialchars((string)$value, ENT_HTML5) |
|
275 | + htmlspecialchars((string) $value, ENT_HTML5) |
|
276 | 276 | ) |
277 | 277 | ); |
278 | 278 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | private function formatRenderedText($renderedText) |
285 | 285 | { |
286 | - $text = $this->stylesRenderer->renderFormatting((string)$renderedText); |
|
286 | + $text = $this->stylesRenderer->renderFormatting((string) $renderedText); |
|
287 | 287 | $res = $this->stylesRenderer->renderAffixes($text); |
288 | 288 | if (!empty($res)) { |
289 | 289 | $res = $this->removeConsecutiveChars($res); |
@@ -53,12 +53,12 @@ |
||
53 | 53 | if (preg_match("/([^\.,;]+)([\.,;]{1,})$/", $text, $match)) { |
54 | 54 | $punctuation = substr($match[2], -1); |
55 | 55 | if ($this->suffix !== $punctuation) { |
56 | - $text = $match[1] . substr($match[2], 0, strlen($match[2]) - 1); |
|
57 | - return $openQuote . $text . $closeQuote . $punctuation; |
|
56 | + $text = $match[1].substr($match[2], 0, strlen($match[2]) - 1); |
|
57 | + return $openQuote.$text.$closeQuote.$punctuation; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
61 | - return $openQuote . $text . $closeQuote; |
|
61 | + return $openQuote.$text.$closeQuote; |
|
62 | 62 | } |
63 | 63 | return $text; |
64 | 64 | } |