@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public static function appendParticleTo(&$data, $namePart, $particle) |
69 | 69 | { |
70 | 70 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
71 | - $data->{$namePart} = $data->{$namePart} . " " . $data->{$particle}; // append $particle to $namePart |
|
71 | + $data->{$namePart} = $data->{$namePart}." ".$data->{$particle}; // append $particle to $namePart |
|
72 | 72 | unset($data->{$particle}); //remove particle from $data |
73 | 73 | } |
74 | 74 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public static function prependParticleTo(&$data, $namePart, $particle) |
83 | 83 | { |
84 | 84 | if (isset($data->{$particle}) && isset($data->{$namePart})) { |
85 | - $data->{$namePart} = $data->{$particle} . " " . $data->{$namePart}; //prepend $particle to $namePart |
|
85 | + $data->{$namePart} = $data->{$particle}." ".$data->{$namePart}; //prepend $particle to $namePart |
|
86 | 86 | unset($data->{$particle}); //remove particle from $data |
87 | 87 | } |
88 | 88 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | if (empty($data->family)) { |
120 | 120 | throw new CiteProcException("Illegal argument. Name has no family name."); |
121 | 121 | } |
122 | - return $data->family . (isset($data->given) ? $data->given : ""); |
|
122 | + return $data->family.(isset($data->given) ? $data->given : ""); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | public static function addExtendedMarkup($nameVar, $nameItem, $formattedName) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $dateTime = new \DateTime($date->{'raw'}); |
58 | 58 | $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]]; |
59 | 59 | } catch (\Exception $e) { |
60 | - throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e); |
|
60 | + throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $arr; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } else if ($match === "any" && count($dateParts) === 2) { |
110 | 110 | return true; |
111 | 111 | } else { |
112 | - $ret = ($match === "all") ? $ret & true : $ret | true; |
|
112 | + $ret = ($match === "all") ? $ret&true : $ret|true; |
|
113 | 113 | } |
114 | 114 | } |
115 | 115 | return boolval($ret); |
@@ -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); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $then = mb_substr($string, 1, $strlen - 1, $encoding); |
140 | 140 | |
141 | 141 | $encoding = Mbstring::mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true); |
142 | - return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding) . $then : $firstChar . $then; |
|
142 | + return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -158,13 +158,13 @@ discard block |
||
158 | 158 | foreach ($spaceExploded as $givenPart) { |
159 | 159 | $firstLetter = mb_substr($givenPart, 0, 1, "UTF-8"); |
160 | 160 | if (StringHelper::isLatinString($firstLetter)) { |
161 | - $res .= ctype_upper($firstLetter) ? $firstLetter . $initializeSign : " " . $givenPart . " "; |
|
161 | + $res .= ctype_upper($firstLetter) ? $firstLetter.$initializeSign : " ".$givenPart." "; |
|
162 | 162 | } else { |
163 | - $res .= $firstLetter . $initializeSign; |
|
163 | + $res .= $firstLetter.$initializeSign; |
|
164 | 164 | } |
165 | 165 | } |
166 | 166 | if ($i < count($exploded) - 1 && $initializeWithHyphen) { |
167 | - $res = rtrim($res) . "-"; |
|
167 | + $res = rtrim($res)."-"; |
|
168 | 168 | } |
169 | 169 | ++$i; |
170 | 170 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | public static function replaceOuterQuotes($text, $outerOpenQuote, $outerCloseQuote, $innerOpenQuote, $innerCloseQuote) |
223 | 223 | { |
224 | 224 | if (preg_match("/(.*)$outerOpenQuote(.+)$outerCloseQuote(.*)/u", $text, $match)) { |
225 | - return $match[1] . $innerOpenQuote . $match[2] . $innerCloseQuote . $match[3]; |
|
225 | + return $match[1].$innerOpenQuote.$match[2].$innerCloseQuote.$match[3]; |
|
226 | 226 | } |
227 | 227 | return $text; |
228 | 228 | } |
@@ -252,6 +252,6 @@ discard block |
||
252 | 252 | * @return mixed |
253 | 253 | */ |
254 | 254 | public static function removeBrackets($datePart) { |
255 | - return str_replace(["[","]", "(", ")", "{", "}"], "", $datePart); |
|
255 | + return str_replace(["[", "]", "(", ")", "{", "}"], "", $datePart); |
|
256 | 256 | } |
257 | 257 | } |
258 | 258 | \ No newline at end of file |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | public static function create($node, $param = null) |
56 | 56 | { |
57 | - $nodeClass = self::CITE_PROC_NODE_NAMESPACE . self::$nodes[$node->getName()]; |
|
57 | + $nodeClass = self::CITE_PROC_NODE_NAMESPACE.self::$nodes[$node->getName()]; |
|
58 | 58 | if (!class_exists($nodeClass)) { |
59 | 59 | throw new ClassNotFoundException($nodeClass); |
60 | 60 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | $digitFrom = $from{$i}; |
66 | 66 | if ($digitTo !== $digitFrom) { |
67 | - $resTo = $digitTo . $resTo; |
|
67 | + $resTo = $digitTo.$resTo; |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | return $resTo; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | { |
78 | 78 | |
79 | 79 | if ($from > 100 && ($from % 100 > 0) && intval(($from / 100), 10) === intval(($to / 100), 10)) { |
80 | - return "" . ($to % 100); |
|
80 | + return "".($to % 100); |
|
81 | 81 | } else if ($from >= 10000) { |
82 | - return "" . ($to % 1000); |
|
82 | + return "".($to % 1000); |
|
83 | 83 | } |
84 | 84 | return $to; |
85 | 85 | } |
@@ -74,7 +74,7 @@ |
||
74 | 74 | $len = strlen($numStr); |
75 | 75 | for ($pos = 0; $pos < $len; $pos++) { |
76 | 76 | $n = $numStr[$pos]; |
77 | - $ret = self::ROMAN_NUMERALS[$pos][$n] . $ret; |
|
77 | + $ret = self::ROMAN_NUMERALS[$pos][$n].$ret; |
|
78 | 78 | } |
79 | 79 | } |
80 | 80 | return $ret; |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public static function loadStyleSheet($styleName) |
36 | 36 | { |
37 | - $stylesPath = self::vendorPath() . "/citation-style-language/styles-distribution/"; |
|
38 | - return file_get_contents($stylesPath . $styleName . '.csl'); |
|
37 | + $stylesPath = self::vendorPath()."/citation-style-language/styles-distribution/"; |
|
38 | + return file_get_contents($stylesPath.$styleName.'.csl'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public static function loadLocales($langKey) |
49 | 49 | { |
50 | - $localesPath = self::vendorPath() . "/citation-style-language/locales/"; |
|
51 | - $localeFile = $localesPath . "locales-" . $langKey . '.xml'; |
|
50 | + $localesPath = self::vendorPath()."/citation-style-language/locales/"; |
|
51 | + $localeFile = $localesPath."locales-".$langKey.'.xml'; |
|
52 | 52 | if (file_exists($localeFile)) { |
53 | 53 | $data = file_get_contents($localeFile); |
54 | 54 | } else { |
55 | 55 | $metadata = self::loadLocalesMetadata(); |
56 | 56 | if (!empty($metadata->{'primary-dialects'}->{$langKey})) { |
57 | - $data = file_get_contents($localesPath . "locales-" . $metadata->{'primary-dialects'}->{$langKey} . '.xml'); |
|
57 | + $data = file_get_contents($localesPath."locales-".$metadata->{'primary-dialects'}->{$langKey}.'.xml'); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | public static function loadLocalesMetadata() |
65 | 65 | { |
66 | - $localesMetadataPath = self::vendorPath() . "/citation-style-language/locales/locales.json"; |
|
66 | + $localesMetadataPath = self::vendorPath()."/citation-style-language/locales/locales.json"; |
|
67 | 67 | return json_decode(file_get_contents($localesMetadataPath)); |
68 | 68 | } |
69 | 69 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | private static function vendorPath() |
75 | 75 | { |
76 | - include_once __DIR__ . '/../../../vendorPath.php'; |
|
76 | + include_once __DIR__.'/../../../vendorPath.php'; |
|
77 | 77 | if (!($vendorPath = vendorPath())) { |
78 | 78 | // @codeCoverageIgnoreStart |
79 | 79 | throw new CiteProcException('vendor path not found. Use composer to initialize your project'); |