@@ -46,6 +46,9 @@ |
||
| 46 | 46 | return $this->language; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $type |
|
| 51 | + */ |
|
| 49 | 52 | public function filter($type, $name, $form = "long") { |
| 50 | 53 | |
| 51 | 54 | if (!isset($this->{$type})) { |
@@ -130,7 +130,7 @@ |
||
| 130 | 130 | * addition, the “editortranslator” term is used if the Names element contains a Label element, replacing the |
| 131 | 131 | * default “editor” and “translator” terms (e.g. resulting in “Doe (editor & translator)”). |
| 132 | 132 | * |
| 133 | - * @param $data |
|
| 133 | + * @param \stdClass $data |
|
| 134 | 134 | * @return string |
| 135 | 135 | */ |
| 136 | 136 | public function render($data) |
@@ -48,15 +48,12 @@ |
||
| 48 | 48 | { |
| 49 | 49 | if (is_numeric($evalValue)) { |
| 50 | 50 | return true; |
| 51 | - } |
|
| 52 | - else if (preg_match(Number::PATTERN_ORDINAL, $evalValue)) { |
|
| 51 | + } else if (preg_match(Number::PATTERN_ORDINAL, $evalValue)) { |
|
| 53 | 52 | $numberFormatter = new NumberFormatter(CiteProc::getContext()->getLocale()->getLanguage(), NumberFormatter::ORDINAL); |
| 54 | 53 | return $numberFormatter->parse($evalValue) !== false; |
| 55 | - } |
|
| 56 | - else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) { |
|
| 54 | + } else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) { |
|
| 57 | 55 | return Number::roman2Dec($evalValue) !== false; |
| 58 | - } |
|
| 59 | - else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){ |
|
| 56 | + } else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){ |
|
| 60 | 57 | return true; |
| 61 | 58 | } |
| 62 | 59 | return false; |
@@ -49,6 +49,9 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | + /** |
|
| 53 | + * @param string $lang |
|
| 54 | + */ |
|
| 52 | 55 | public static function loadLocale($lang) { |
| 53 | 56 | $directory = __DIR__."/../../../../vendor/academicpuma/locales"; |
| 54 | 57 | $file = $directory . "/locales-" . ($lang) . ".xml"; |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | foreach ($this->formattingOptions as $option => $optionValue) { |
| 59 | 59 | if ($optionValue === "italic") { |
| 60 | 60 | $text = "<i>$text</i>"; |
| 61 | - } |
|
| 62 | - else if ($optionValue === "bold") { |
|
| 61 | + } else if ($optionValue === "bold") { |
|
| 63 | 62 | $text = "<b>$text</b>"; |
| 64 | 63 | } else { |
| 65 | 64 | $format .= "$option:$optionValue;"; |