@@ -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)) { |
@@ -36,18 +36,18 @@ |
||
36 | 36 | if ($this->quotes) { |
37 | 37 | $openQuote = $this->locale->filter("terms", "open-quote")->single; |
38 | 38 | $closeQuote = $this->locale->filter("terms", "close-quote")->single; |
39 | - $punctuationInQuotes =$this->locale->filter("options", "punctuation-in-quote"); |
|
39 | + $punctuationInQuotes = $this->locale->filter("options", "punctuation-in-quote"); |
|
40 | 40 | $text = $this->replaceOuterQuotes($text, $openQuote, $closeQuote); |
41 | 41 | if (null !== $punctuationInQuotes || $punctuationInQuotes === false) { |
42 | 42 | if (preg_match("/([^\.,;]+)([\.,;]{1,})$/", $text, $match)) { |
43 | 43 | $punctuation = substr($match[2], -1); |
44 | 44 | if ($this->suffix !== $punctuation) { |
45 | - $text = $match[1] . substr($match[2], 0, strlen($match[2]) - 1); |
|
46 | - return $openQuote . $text . $closeQuote . $punctuation; |
|
45 | + $text = $match[1].substr($match[2], 0, strlen($match[2]) - 1); |
|
46 | + return $openQuote.$text.$closeQuote.$punctuation; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
50 | - return $openQuote . $text . $closeQuote; |
|
50 | + return $openQuote.$text.$closeQuote; |
|
51 | 51 | } |
52 | 52 | return $text; |
53 | 53 | } |
@@ -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); |