@@ -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); |
@@ -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; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | public static function capitalizeForTitle($titleString) |
| 94 | 94 | { |
| 95 | 95 | if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) { |
| 96 | - $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3]; |
|
| 96 | + $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3]; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $wordArray = explode(" ", $titleString); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | /** @noinspection PhpInternalEntityUsedInspection */ |
| 143 | 143 | $encoding = Mbstring::mb_detect_encoding($firstChar, self::ISO_ENCODINGS, true); |
| 144 | - return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding) . $then : $firstChar . $then; |
|
| 144 | + return in_array($encoding, self::ISO_ENCODINGS) ? Mbstring::mb_strtoupper($firstChar, $encoding).$then : $firstChar.$then; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -160,13 +160,13 @@ discard block |
||
| 160 | 160 | foreach ($spaceExploded as $givenPart) { |
| 161 | 161 | $firstLetter = mb_substr($givenPart, 0, 1, "UTF-8"); |
| 162 | 162 | if (StringHelper::isLatinString($firstLetter)) { |
| 163 | - $res .= ctype_upper($firstLetter) ? $firstLetter . $initializeSign : " " . $givenPart . " "; |
|
| 163 | + $res .= ctype_upper($firstLetter) ? $firstLetter.$initializeSign : " ".$givenPart." "; |
|
| 164 | 164 | } else { |
| 165 | - $res .= $firstLetter . $initializeSign; |
|
| 165 | + $res .= $firstLetter.$initializeSign; |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | if ($i < count($exploded) - 1 && $initializeWithHyphen) { |
| 169 | - $res = rtrim($res) . "-"; |
|
| 169 | + $res = rtrim($res)."-"; |
|
| 170 | 170 | } |
| 171 | 171 | ++$i; |
| 172 | 172 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | public static function replaceOuterQuotes($text, $outerOpenQuote, $outerCloseQuote, $innerOpenQuote, $innerCloseQuote) |
| 225 | 225 | { |
| 226 | 226 | if (preg_match("/(.*)$outerOpenQuote(.+)$outerCloseQuote(.*)/u", $text, $match)) { |
| 227 | - return $match[1] . $innerOpenQuote . $match[2] . $innerCloseQuote . $match[3]; |
|
| 227 | + return $match[1].$innerOpenQuote.$match[2].$innerCloseQuote.$match[3]; |
|
| 228 | 228 | } |
| 229 | 229 | return $text; |
| 230 | 230 | } |
@@ -254,6 +254,6 @@ discard block |
||
| 254 | 254 | * @return mixed |
| 255 | 255 | */ |
| 256 | 256 | public static function removeBrackets($datePart) { |
| 257 | - return str_replace(["[","]", "(", ")", "{", "}"], "", $datePart); |
|
| 257 | + return str_replace(["[", "]", "(", ")", "{", "}"], "", $datePart); |
|
| 258 | 258 | } |
| 259 | 259 | } |
| 260 | 260 | \ No newline at end of file |
@@ -54,9 +54,9 @@ |
||
| 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 | - throw new InvalidStylesheetException("For node {$node->getName()} does not exist any counterpart class \"" . $nodeClass . "\". The given stylesheet seems to be invalid."); |
|
| 59 | + throw new InvalidStylesheetException("For node {$node->getName()} does not exist any counterpart class \"".$nodeClass."\". The given stylesheet seems to be invalid."); |
|
| 60 | 60 | } |
| 61 | 61 | if ($param != null) { |
| 62 | 62 | return new $nodeClass($node, $param); |
@@ -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 | /** |
@@ -48,14 +48,14 @@ discard block |
||
| 48 | 48 | public static function loadLocales($langKey) |
| 49 | 49 | { |
| 50 | 50 | $data = null; |
| 51 | - $localesPath = self::vendorPath() . "/citation-style-language/locales/"; |
|
| 52 | - $localeFile = $localesPath . "locales-" . $langKey . '.xml'; |
|
| 51 | + $localesPath = self::vendorPath()."/citation-style-language/locales/"; |
|
| 52 | + $localeFile = $localesPath."locales-".$langKey.'.xml'; |
|
| 53 | 53 | if (file_exists($localeFile)) { |
| 54 | 54 | $data = file_get_contents($localeFile); |
| 55 | 55 | } else { |
| 56 | 56 | $metadata = self::loadLocalesMetadata(); |
| 57 | 57 | if (!empty($metadata->{'primary-dialects'}->{$langKey})) { |
| 58 | - $data = file_get_contents($localesPath . "locales-" . $metadata->{'primary-dialects'}->{$langKey} . '.xml'); |
|
| 58 | + $data = file_get_contents($localesPath."locales-".$metadata->{'primary-dialects'}->{$langKey}.'.xml'); |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public static function loadLocalesMetadata() |
| 70 | 70 | { |
| 71 | - $localesMetadataPath = self::vendorPath() . "/citation-style-language/locales/locales.json"; |
|
| 71 | + $localesMetadataPath = self::vendorPath()."/citation-style-language/locales/locales.json"; |
|
| 72 | 72 | return json_decode(file_get_contents($localesMetadataPath)); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | private static function vendorPath() |
| 80 | 80 | { |
| 81 | - include_once __DIR__ . '/../../../vendorPath.php'; |
|
| 81 | + include_once __DIR__.'/../../../vendorPath.php'; |
|
| 82 | 82 | if (!($vendorPath = vendorPath())) { |
| 83 | 83 | // @codeCoverageIgnoreStart |
| 84 | 84 | throw new CiteProcException('vendor path not found. Use composer to initialize your project'); |