@@ -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})) { |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | namespace Seboettg\CiteProc\Locale; |
| 3 | 3 | use Seboettg\CiteProc\Util\Factory; |
| 4 | -use Seboettg\Collection\ArrayList; |
|
| 5 | 4 | |
| 6 | 5 | /** |
| 7 | 6 | */ |
@@ -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) |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | /** @var \SimpleXMLElement $attribute */ |
| 112 | 112 | foreach ($node->attributes() as $attribute) { |
| 113 | 113 | if ("variable" === $attribute->getName()) { |
| 114 | - $this->variables = new ArrayList(explode(" ", (string)$attribute)); |
|
| 114 | + $this->variables = new ArrayList(explode(" ", (string) $attribute)); |
|
| 115 | 115 | break; |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | - $str .= implode($this->delimiter, $results); |
|
| 189 | + $str .= implode($this->delimiter, $results); |
|
| 190 | 190 | return $this->addAffixes($str); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -5,7 +5,6 @@ |
||
| 5 | 5 | use Seboettg\CiteProc\Styles\AffixesTrait; |
| 6 | 6 | use Seboettg\CiteProc\Styles\DisplayTrait; |
| 7 | 7 | use Seboettg\CiteProc\Styles\FormattingTrait; |
| 8 | -use Seboettg\CiteProc\Styles\QuotesTrait; |
|
| 9 | 8 | use Seboettg\CiteProc\Styles\TextCaseTrait; |
| 10 | 9 | |
| 11 | 10 | |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | foreach ($node->attributes() as $attribute) { |
| 37 | 37 | |
| 38 | 38 | /** @var string $name */ |
| 39 | - $name = (string)$attribute->getName(); |
|
| 40 | - $value = (string)$attribute; |
|
| 39 | + $name = (string) $attribute->getName(); |
|
| 40 | + $value = (string) $attribute; |
|
| 41 | 41 | |
| 42 | 42 | if (in_array($name, self::$formattingAttributes)) { |
| 43 | 43 | $this->formattingOptions->add($name, $value); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | if (!empty($format)) { |
| 66 | - $text = '<span style="' . $format . '">'.$text.'</span>'; |
|
| 66 | + $text = '<span style="' . $format . '">' . $text . '</span>'; |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | return $text; |
@@ -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;"; |
@@ -18,8 +18,8 @@ |
||
| 18 | 18 | /** @var \SimpleXMLElement $attribute */ |
| 19 | 19 | foreach ($node->attributes() as $attribute) { |
| 20 | 20 | /** @var string $name */ |
| 21 | - $name = (string)$attribute->getName(); |
|
| 22 | - $value = (string)$attribute; |
|
| 21 | + $name = (string) $attribute->getName(); |
|
| 22 | + $value = (string) $attribute; |
|
| 23 | 23 | |
| 24 | 24 | switch ($name) { |
| 25 | 25 | case 'prefix': |
@@ -27,10 +27,10 @@ |
||
| 27 | 27 | { |
| 28 | 28 | $className = ""; |
| 29 | 29 | $parts = explode("-", $name); |
| 30 | - array_walk($parts, function ($part) use (&$className) { |
|
| 30 | + array_walk($parts, function($part) use (&$className) { |
|
| 31 | 31 | $className .= ucfirst($part); |
| 32 | 32 | }); |
| 33 | - $className = self::NAMESPACE_CONSTRAINTS.$className; |
|
| 33 | + $className = self::NAMESPACE_CONSTRAINTS . $className; |
|
| 34 | 34 | |
| 35 | 35 | if (!class_exists($className)) { |
| 36 | 36 | throw new ClassNotFoundException($className); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | foreach ($node->children() as $child) { |
| 64 | 64 | if ($child->getName() === "date-part") { |
| 65 | 65 | $datePartName = (string) $child->attributes()["name"]; |
| 66 | - $this->dateParts->set($this->form."-".$datePartName, Util\Factory::create($child)); |
|
| 66 | + $this->dateParts->set($this->form . "-" . $datePartName, Util\Factory::create($child)); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $ret = ""; |
| 83 | 83 | $var = null; |
| 84 | - if(isset($data->{$this->variable})) { |
|
| 84 | + if (isset($data->{$this->variable})) { |
|
| 85 | 85 | $var = $data->{$this->variable}; |
| 86 | 86 | } else { |
| 87 | 87 | return ""; |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | public static function loadLocale($lang) { |
| 52 | - $directory = __DIR__."/../../../../vendor/academicpuma/locales"; |
|
| 52 | + $directory = __DIR__ . "/../../../../vendor/academicpuma/locales"; |
|
| 53 | 53 | $file = $directory . "/locales-" . ($lang) . ".xml"; |
| 54 | 54 | |
| 55 | 55 | if (file_exists($file) == 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"; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | $year = isset($dateParts[0]) ? $dateParts[0] : "0000"; |
| 34 | 34 | $month = isset($dateParts[1]) ? $dateParts[1] : "00"; |
| 35 | - $day = isset($dateParts[2]) ? $dateParts[2] : "00"; |
|
| 35 | + $day = isset($dateParts[2]) ? $dateParts[2] : "00"; |
|
| 36 | 36 | |
| 37 | 37 | return sprintf("%04d%02d%02d", $year, $month, $day); |
| 38 | 38 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | $dateTime = new \DateTime($date->{'raw'}); |
| 47 | 47 | $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]]; |
| 48 | 48 | } catch (\Exception $e) { |
| 49 | - throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e); |
|
| 49 | + throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | return $arr; |