@@ -56,7 +56,7 @@ |
||
56 | 56 | foreach ($node->attributes() as $attribute) { |
57 | 57 | $name = $attribute->getName(); |
58 | 58 | if ($name === "variable") { |
59 | - $this->variable = (string)$attribute; |
|
59 | + $this->variable = (string) $attribute; |
|
60 | 60 | } |
61 | 61 | if ($name === "sort") { |
62 | 62 | $this->sort = (string) $attribute; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function sort(&$data) |
52 | 52 | { |
53 | 53 | //begin with last sort key |
54 | - for ($i = $this->sortingKeys->count()-1; $i >= 0; --$i) { |
|
54 | + for ($i = $this->sortingKeys->count() - 1; $i >= 0; --$i) { |
|
55 | 55 | /** @var Key $key */ |
56 | 56 | $key = $this->sortingKeys->get($i); |
57 | 57 | $variable = $key->getVariable(); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | if ($key->isNameVariable()) { |
68 | 68 | |
69 | - usort($data, function ($a, $b) use ($variable, $order) { |
|
69 | + usort($data, function($a, $b) use ($variable, $order) { |
|
70 | 70 | /** |
71 | 71 | * @param $a |
72 | 72 | * @param $key |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * If the original variable value only consists of non-numeric text, the value is returned as a text string. |
87 | 87 | */ |
88 | 88 | if ($key->isNumberVariable()) { |
89 | - usort($data,function ($a, $b) use ($variable, $order) { |
|
89 | + usort($data, function($a, $b) use ($variable, $order) { |
|
90 | 90 | $numA = $a->{$variable}; |
91 | 91 | $numB = $b->{$variable}; |
92 | 92 | $compareNumber = Number::getCompareNumber(); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * chronological order of the seasons differs between the northern and southern hemispheres. |
102 | 102 | */ |
103 | 103 | if ($key->isDateVariable()) { |
104 | - usort($data,function ($a, $b) use ($variable, $order) { |
|
104 | + usort($data, function($a, $b) use ($variable, $order) { |
|
105 | 105 | $numA = Date::serializeDate($a->{$variable}); |
106 | 106 | $numB = Date::serializeDate($b->{$variable}); |
107 | 107 | $compareNumber = Number::getCompareNumber(); |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * formatting attributes. |
45 | 45 | */ |
46 | 46 | case 'layout': |
47 | - $this->layout = new Layout($child); |
|
47 | + $this->layout = new Layout($child); |
|
48 | 48 | break; |
49 | 49 | |
50 | 50 | /* cs:citation and cs:bibliography may include a cs:sort child element before the cs:layout element to |
@@ -30,11 +30,11 @@ |
||
30 | 30 | { |
31 | 31 | $nameParts = explode("-", $name); |
32 | 32 | $attr = ""; |
33 | - for ($i = count($nameParts)-1; $i >= 0; --$i) { |
|
33 | + for ($i = count($nameParts) - 1; $i >= 0; --$i) { |
|
34 | 34 | if ($i > 0) { |
35 | 35 | $attr = ucfirst($nameParts[$i]) . $attr; |
36 | 36 | } else { |
37 | - $attr = $nameParts[$i].$attr; |
|
37 | + $attr = $nameParts[$i] . $attr; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | if (!isset($this->{$attr})) { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | private function parseXml(\SimpleXMLElement $locale) |
53 | 53 | { |
54 | 54 | foreach ($locale as $node) { |
55 | - switch($node->getName()) { |
|
55 | + switch ($node->getName()) { |
|
56 | 56 | case 'style-options': |
57 | 57 | $this->optionsXml->add('options', $node); |
58 | 58 | foreach ($node->attributes() as $name => $value) { |
@@ -29,19 +29,19 @@ |
||
29 | 29 | |
30 | 30 | if (!function_exists('vendorPath')) { |
31 | 31 | |
32 | - /** |
|
33 | - * @return bool|string returns path of composer vendor folder, and false if folder does not exist |
|
34 | - */ |
|
35 | - function vendorPath() { |
|
32 | + /** |
|
33 | + * @return bool|string returns path of composer vendor folder, and false if folder does not exist |
|
34 | + */ |
|
35 | + function vendorPath() { |
|
36 | 36 | |
37 | - if (file_exists(__DIR__ . '/vendor/')) { |
|
38 | - return __DIR__ . '/vendor'; |
|
39 | - } else { |
|
40 | - if (!file_exists(__DIR__ . '/../../')) { |
|
41 | - return false; |
|
42 | - } else { |
|
43 | - return __DIR__ . '/../..'; |
|
44 | - } |
|
45 | - } |
|
46 | - } |
|
37 | + if (file_exists(__DIR__ . '/vendor/')) { |
|
38 | + return __DIR__ . '/vendor'; |
|
39 | + } else { |
|
40 | + if (!file_exists(__DIR__ . '/../../')) { |
|
41 | + return false; |
|
42 | + } else { |
|
43 | + return __DIR__ . '/../..'; |
|
44 | + } |
|
45 | + } |
|
46 | + } |
|
47 | 47 | } |
48 | 48 | \ No newline at end of file |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public static function getCompareNumber() |
59 | 59 | { |
60 | - return function ($numA, $numB, $order) { |
|
60 | + return function($numA, $numB, $order) { |
|
61 | 61 | if (is_numeric($numA) && is_numeric($numB)) { |
62 | 62 | $ret = $numA - $numB; |
63 | 63 | } else { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | "I" => 1 |
139 | 139 | ]; |
140 | 140 | |
141 | - if(is_numeric($romanNumber)) { |
|
141 | + if (is_numeric($romanNumber)) { |
|
142 | 142 | return 0; |
143 | 143 | } |
144 | 144 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | |
154 | 154 | $sum = 0; |
155 | - while($current = current($values)) { |
|
155 | + while ($current = current($values)) { |
|
156 | 156 | $next = next($values); |
157 | 157 | $next > $current ? $sum += $next - $current + 0 * next($values) : $sum += $current; |
158 | 158 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | else if (preg_match(Number::PATTERN_ROMAN, $evalValue)) { |
57 | 57 | return Number::roman2Dec($evalValue) !== false; |
58 | 58 | } |
59 | - else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)){ |
|
59 | + else if (preg_match(Number::PATTERN_COMMA_AMPERSAND_RANGE, $evalValue)) { |
|
60 | 60 | return true; |
61 | 61 | } |
62 | 62 | return false; |
@@ -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; |
@@ -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': |