@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | /** @var \SimpleXMLElement $node */ |
| 62 | 62 | foreach ($locale as $node) { |
| 63 | - switch($node->getName()) { |
|
| 63 | + switch ($node->getName()) { |
|
| 64 | 64 | case 'style-options': |
| 65 | 65 | $this->optionsXml->add('options', $node); |
| 66 | 66 | foreach ($node->attributes() as $name => $value) { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | break; |
| 110 | 110 | case 'date': |
| 111 | - $form = (string)$node["form"]; |
|
| 111 | + $form = (string) $node["form"]; |
|
| 112 | 112 | $this->dateXml->add($form, $node); |
| 113 | 113 | foreach ($node->children() as $child) { |
| 114 | 114 | $date = new \stdClass(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $wordArray = explode(" ", $text); |
| 66 | 66 | |
| 67 | - array_walk($wordArray, function (&$word) { |
|
| 67 | + array_walk($wordArray, function(&$word) { |
|
| 68 | 68 | $word = ucfirst($word); |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -74,16 +74,16 @@ discard block |
||
| 74 | 74 | public static function capitalizeForTitle($titleString) |
| 75 | 75 | { |
| 76 | 76 | if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) { |
| 77 | - $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3]; |
|
| 77 | + $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3]; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $wordArray = explode(" ", $titleString); |
| 81 | 81 | |
| 82 | - array_walk($wordArray, function (&$word) { |
|
| 82 | + array_walk($wordArray, function(&$word) { |
|
| 83 | 83 | |
| 84 | 84 | $words = explode("-", $word); |
| 85 | 85 | if (count($words) > 1) { |
| 86 | - array_walk($words, function (&$w) { |
|
| 86 | + array_walk($words, function(&$w) { |
|
| 87 | 87 | $w = StringHelper::keepLowerCase($w) ? $w : StringHelper::mb_ucfirst($w); |
| 88 | 88 | }); |
| 89 | 89 | $word = implode("-", $words); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public static function keepLowerCase($word) |
| 98 | 98 | { |
| 99 | - $lowerCase = in_array($word, self::PREPOSITIONS) || |
|
| 99 | + $lowerCase = in_array($word, self::PREPOSITIONS) || |
|
| 100 | 100 | in_array($word, self::ARTICLES) || |
| 101 | 101 | in_array($word, self::CONJUNCTIONS) || |
| 102 | 102 | in_array($word, self::ADJECTIVES); |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | foreach ($node->attributes() as $name => $value) { |
| 49 | 49 | if ('match' !== $name) { |
| 50 | - $this->constraints->append(Factory::createConstraint((string)$name, (string)$value)); |
|
| 50 | + $this->constraints->append(Factory::createConstraint((string) $name, (string) $value)); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | - * @return mixed |
|
| 107 | + * @return Choose |
|
| 108 | 108 | */ |
| 109 | 109 | public function getParent() |
| 110 | 110 | { |
@@ -79,6 +79,10 @@ |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | + /** |
|
| 83 | + * @param string $render |
|
| 84 | + * @param string $original |
|
| 85 | + */ |
|
| 82 | 86 | private function keepNoCase($render, $original) |
| 83 | 87 | { |
| 84 | 88 | if (preg_match('/<span class=\"nocase\">(\p{L}+)<\/span>/i', $original, $match)) { |
@@ -522,6 +522,9 @@ |
||
| 522 | 522 | return false; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | + /** |
|
| 526 | + * @param \stdClass $precedingItem |
|
| 527 | + */ |
|
| 525 | 528 | private function identicalAuthors($precedingItem, $currentAuthor) |
| 526 | 529 | { |
| 527 | 530 | if (count($precedingItem->author) !== count($currentAuthor)) { |
@@ -98,9 +98,9 @@ |
||
| 98 | 98 | $sortKey = $dataItem->{$variable}; |
| 99 | 99 | } else if ($key->isDateVariable()) { |
| 100 | 100 | $sortKey = Date::getSortKeyDate($variable, $dataItem); |
| 101 | - } else if ($key->isMacro()){ |
|
| 101 | + } else if ($key->isMacro()) { |
|
| 102 | 102 | $sortKey = mb_strtolower(strip_tags(CiteProc::getContext()->getMacro($key->getMacro())->render($dataItem, $citationNumber))); |
| 103 | - } else if ($variable === "citation-number"){ |
|
| 103 | + } else if ($variable === "citation-number") { |
|
| 104 | 104 | $sortKey = $citationNumber + 1; |
| 105 | 105 | } else { |
| 106 | 106 | $sortKey = mb_strtolower(strip_tags($dataItem->{$variable})); |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | $sortKey = Date::getSortKeyDate($variable, $dataItem); |
| 101 | 101 | } else if ($key->isMacro()){ |
| 102 | 102 | $sortKey = mb_strtolower(strip_tags(CiteProc::getContext()->getMacro($key->getMacro())->render($dataItem, $citationNumber))); |
| 103 | - } else if ($variable === "citation-number"){ |
|
| 103 | + } else if ($variable === "citation-number"){ |
|
| 104 | 104 | $sortKey = $citationNumber + 1; |
| 105 | 105 | } else { |
| 106 | 106 | $sortKey = mb_strtolower(strip_tags($dataItem->{$variable})); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $year = isset($dateParts[0]) ? $dateParts[0] : "0000"; |
| 39 | 39 | $month = isset($dateParts[1]) ? $dateParts[1] : "00"; |
| 40 | - $day = isset($dateParts[2]) ? $dateParts[2] : "00"; |
|
| 40 | + $day = isset($dateParts[2]) ? $dateParts[2] : "00"; |
|
| 41 | 41 | |
| 42 | 42 | return sprintf("%04d%02d%02d", $year, $month, $day); |
| 43 | 43 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $dateTime = new \DateTime($date->{'raw'}); |
| 52 | 52 | $arr = [[$dateTime->format("Y"), $dateTime->format("m"), $dateTime->format("d")]]; |
| 53 | 53 | } catch (\Exception $e) { |
| 54 | - throw new CiteProcException("Could not parse date \"".$date->{'raw'}."\".", 0, $e); |
|
| 54 | + throw new CiteProcException("Could not parse date \"" . $date->{'raw'} . "\".", 0, $e); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | return $arr; |