@@ -110,22 +110,22 @@ |
||
| 110 | 110 | $styleSheet = loadStyleSheet("ieee"); |
| 111 | 111 | $citeProc = new CiteProc($style, Locale::EN_US(), [ |
| 112 | 112 | "bibliography" => [ |
| 113 | - "author" => function ($authorItem, $renderedText) { |
|
| 113 | + "author" => function($authorItem, $renderedText) { |
|
| 114 | 114 | if (isset($authorItem->id)) { |
| 115 | - return '<a href="https://example.org/author/' . $authorItem->id . '">' . $renderedText . '</a>'; |
|
| 115 | + return '<a href="https://example.org/author/'.$authorItem->id.'">'.$renderedText.'</a>'; |
|
| 116 | 116 | } |
| 117 | 117 | return $renderedText; |
| 118 | 118 | }, |
| 119 | - "title" => function ($cslItem, $renderedText) { |
|
| 120 | - return '<a href="https://example.org/publication/' . $cslItem->id . '">' . $renderedText . '</a>'; |
|
| 119 | + "title" => function($cslItem, $renderedText) { |
|
| 120 | + return '<a href="https://example.org/publication/'.$cslItem->id.'">'.$renderedText.'</a>'; |
|
| 121 | 121 | }, |
| 122 | - "csl-entry" => function ($cslItem, $renderedText) { |
|
| 123 | - return '<a id="' . $cslItem->id . '" href="#' . $cslItem->id . '"></a>' . $renderedText; |
|
| 122 | + "csl-entry" => function($cslItem, $renderedText) { |
|
| 123 | + return '<a id="'.$cslItem->id.'" href="#'.$cslItem->id.'"></a>'.$renderedText; |
|
| 124 | 124 | } |
| 125 | 125 | ], |
| 126 | 126 | "citation" => [ |
| 127 | - "citation-number" => function ($cslItem, $renderedText) { |
|
| 128 | - return '<a href="#' . $cslItem->id . '">' . $renderedText . '</a>'; |
|
| 127 | + "citation-number" => function($cslItem, $renderedText) { |
|
| 128 | + return '<a href="#'.$cslItem->id.'">'.$renderedText.'</a>'; |
|
| 129 | 129 | } |
| 130 | 130 | ] |
| 131 | 131 | ]); |
@@ -264,17 +264,17 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | switch ($this->delimiterPrecedesEtAl) { |
| 266 | 266 | case 'never': |
| 267 | - $text = $text . " " . $this->etAl; |
|
| 267 | + $text = $text." ".$this->etAl; |
|
| 268 | 268 | break; |
| 269 | 269 | case 'always': |
| 270 | - $text = $text . $this->delimiter . $this->etAl; |
|
| 270 | + $text = $text.$this->delimiter.$this->etAl; |
|
| 271 | 271 | break; |
| 272 | 272 | case 'contextual': |
| 273 | 273 | default: |
| 274 | 274 | if (count($resultNames) === 1) { |
| 275 | - $text .= " " . $this->etAl; |
|
| 275 | + $text .= " ".$this->etAl; |
|
| 276 | 276 | } else { |
| 277 | - $text .= $this->delimiter . $this->etAl; |
|
| 277 | + $text .= $this->delimiter.$this->etAl; |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | { |
| 483 | 483 | $count = count($resultNames); |
| 484 | 484 | if (!empty($this->and) && $count > 1 && empty($this->etAl)) { |
| 485 | - $new = $this->and . ' ' . end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 485 | + $new = $this->and.' '.end($resultNames); // add and-prefix of the last name if "and" is defined |
|
| 486 | 486 | // set prefixed last name at the last position of $resultNames array |
| 487 | 487 | $resultNames[count($resultNames) - 1] = $new; |
| 488 | 488 | } |
@@ -571,9 +571,9 @@ discard block |
||
| 571 | 571 | $text = !empty($given) ? $given." ".$family : $family; |
| 572 | 572 | } |
| 573 | 573 | } elseif (StringHelper::isAsianString(NameHelper::normalizeName($data))) { |
| 574 | - $text = $this->form === "long" ? $data->family . $data->given : $data->family; |
|
| 574 | + $text = $this->form === "long" ? $data->family.$data->given : $data->family; |
|
| 575 | 575 | } else { |
| 576 | - $text = $this->form === "long" ? $data->family . " " . $data->given : $data->family; |
|
| 576 | + $text = $this->form === "long" ? $data->family." ".$data->given : $data->family; |
|
| 577 | 577 | } |
| 578 | 578 | return $text; |
| 579 | 579 | } |
@@ -53,12 +53,12 @@ discard block |
||
| 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(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | //filter by form |
| 123 | 123 | if ($type !== "options") { |
| 124 | 124 | /** @var Term $value */ |
| 125 | - $array = array_filter($array, function ($term) use ($form) { |
|
| 125 | + $array = array_filter($array, function($term) use ($form) { |
|
| 126 | 126 | return $term->form === $form; |
| 127 | 127 | }); |
| 128 | 128 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $firstChar = substr($string, 0, 1); |
| 23 | 23 | $firstCharUpper = strtr($firstChar, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); |
| 24 | - return $firstCharUpper . substr($string, 1); |
|
| 24 | + return $firstCharUpper.substr($string, 1); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | function vendorPath(): string |
| 32 | 32 | { |
| 33 | - include_once realpath(__DIR__ . '/../') . '/vendorPath.php'; |
|
| 33 | + include_once realpath(__DIR__.'/../').'/vendorPath.php'; |
|
| 34 | 34 | if (!($vendorPath = \vendorPath())) { |
| 35 | 35 | // @codeCoverageIgnoreStart |
| 36 | 36 | throw new CiteProcException('Vendor path not found. Use composer to initialize your project'); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | function loadStyleSheet(string $styleName) |
| 54 | 54 | { |
| 55 | - $stylesPath = vendorPath() . "/citation-style-language/styles-distribution"; |
|
| 55 | + $stylesPath = vendorPath()."/citation-style-language/styles-distribution"; |
|
| 56 | 56 | $fileName = sprintf('%s/%s.csl', $stylesPath, $styleName); |
| 57 | 57 | if (!file_exists($fileName)) { |
| 58 | 58 | throw new CiteProcException(sprintf('Stylesheet "%s" not found', $fileName)); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | function loadLocales(string $langKey) |
| 74 | 74 | { |
| 75 | 75 | $data = null; |
| 76 | - $localesPath = vendorPath() . "/citation-style-language/locales/"; |
|
| 76 | + $localesPath = vendorPath()."/citation-style-language/locales/"; |
|
| 77 | 77 | $localeFile = $localesPath."locales-".$langKey.'.xml'; |
| 78 | 78 | if (file_exists($localeFile)) { |
| 79 | 79 | $data = file_get_contents($localeFile); |
@@ -94,6 +94,6 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | function loadLocalesMetadata() |
| 96 | 96 | { |
| 97 | - $localesMetadataPath = vendorPath() . "/citation-style-language/locales/locales.json"; |
|
| 97 | + $localesMetadataPath = vendorPath()."/citation-style-language/locales/locales.json"; |
|
| 98 | 98 | return json_decode(file_get_contents($localesMetadataPath)); |
| 99 | 99 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | throw new CiteProcException('No valid format for variable data. Either DataList or array expected'); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - switch ((string)$mode) { |
|
| 38 | + switch ((string) $mode) { |
|
| 39 | 39 | case Config\RenderingMode::BIBLIOGRAPHY: |
| 40 | 40 | CiteProc::getContext()->setMode($mode); |
| 41 | 41 | // set CitationItems to Context |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | if (is_array($citationItems)) { |
| 47 | 47 | $citationItems = new ArrayList(...$citationItems); |
| 48 | 48 | } elseif (!($citationItems instanceof ArrayList)) { |
| 49 | - throw new CiteProcException('No valid format for variable ' . |
|
| 50 | - '`citationItems`, ' . |
|
| 49 | + throw new CiteProcException('No valid format for variable '. |
|
| 50 | + '`citationItems`, '. |
|
| 51 | 51 | 'array or ArrayList expected.'); |
| 52 | 52 | } |
| 53 | 53 | CiteProc::getContext()->setMode($mode); |