@@ -44,9 +44,9 @@ |
||
44 | 44 | 'chapter-number', // chapter number |
45 | 45 | 'collection-number', // number identifying the collection holding the item (e.g. the series number for a book) |
46 | 46 | 'edition', // (container) edition holding the item (e.g. “3” when citing a chapter in the third |
47 | - // edition of a book) |
|
47 | + // edition of a book) |
|
48 | 48 | 'issue', // (container) issue holding the item (e.g. “5” when citing a journal article from |
49 | - // journal volume 2, issue 5) |
|
49 | + // journal volume 2, issue 5) |
|
50 | 50 | 'number', // number identifying the item (e.g. a report number) |
51 | 51 | 'number-of-pages', // total number of pages of the cited item |
52 | 52 | 'number-of-volumes', // total number of volumes, usable for citing multi-volume books and such |
@@ -169,7 +169,7 @@ |
||
169 | 169 | $parent = null; |
170 | 170 | $names = new Names( |
171 | 171 | new SimpleXMLElement( |
172 | - "<names variable=\"$variable\" delimiter=\"-\">". |
|
172 | + "<names variable=\"$variable\" delimiter=\"-\">" . |
|
173 | 173 | "<name form=\"long\" sort-separator=\",\" name-as-sort-order=\"all\"/></names>" |
174 | 174 | ), |
175 | 175 | $parent |
@@ -37,7 +37,7 @@ |
||
37 | 37 | return $text; |
38 | 38 | } |
39 | 39 | |
40 | - switch ((string)$this->textCase) { |
|
40 | + switch ((string) $this->textCase) { |
|
41 | 41 | case TextCase::UPPERCASE: |
42 | 42 | $text = $this->keepNoCase(mb_strtoupper($text), $text); |
43 | 43 | break; |
@@ -29,6 +29,6 @@ |
||
29 | 29 | return $text; |
30 | 30 | } |
31 | 31 | |
32 | - return sprintf("<div class=\"csl-%s\">%s</div>", (string)$this->display, $text); |
|
32 | + return sprintf("<div class=\"csl-%s\">%s</div>", (string) $this->display, $text); |
|
33 | 33 | } |
34 | 34 | } |
@@ -35,19 +35,19 @@ |
||
35 | 35 | $name = $attribute->getName(); |
36 | 36 | switch ($name) { |
37 | 37 | case 'prefix': |
38 | - $prefix = (string)$attribute; |
|
38 | + $prefix = (string) $attribute; |
|
39 | 39 | break; |
40 | 40 | case 'suffix': |
41 | - $suffix = (string)$attribute; |
|
41 | + $suffix = (string) $attribute; |
|
42 | 42 | break; |
43 | 43 | case 'text-case': |
44 | - $textCase = new TextCase((string)$attribute); |
|
44 | + $textCase = new TextCase((string) $attribute); |
|
45 | 45 | break; |
46 | 46 | case 'display': |
47 | - $display = new Display((string)$attribute); |
|
47 | + $display = new Display((string) $attribute); |
|
48 | 48 | break; |
49 | 49 | case 'quotes': |
50 | - $quotes = "true" === (string)$attribute; |
|
50 | + $quotes = "true" === (string) $attribute; |
|
51 | 51 | break; |
52 | 52 | default: |
53 | 53 | if (in_array($attribute->getName(), $formattingAttributes)) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | if (!in_array($this->display, self::$allowedValues)) { |
58 | 58 | return $text; |
59 | 59 | } |
60 | - $divStyle = "class=\"csl-".$this->display."\""; |
|
60 | + $divStyle = "class=\"csl-" . $this->display . "\""; |
|
61 | 61 | return "<div $divStyle>$text</div>"; |
62 | 62 | } |
63 | 63 | } |
@@ -42,7 +42,7 @@ |
||
42 | 42 | if (empty($punctuationSign) || preg_match("/^\s+$/", $punctuationSign)) { |
43 | 43 | return $subject; |
44 | 44 | } |
45 | - $pattern = '/'.preg_quote(trim($punctuationSign), '/').'{2,}/'; |
|
45 | + $pattern = '/' . preg_quote(trim($punctuationSign), '/') . '{2,}/'; |
|
46 | 46 | if (preg_match($pattern, $subject)) { |
47 | 47 | return preg_replace($pattern, $punctuationSign, $subject); |
48 | 48 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | */ |
65 | 65 | public function __toString() |
66 | 66 | { |
67 | - $directives = "\t".implode("\n\t", $this->directives->toArray()); |
|
68 | - return $this->selectorType.$this->selector." {\n".$directives."\n}\n"; |
|
67 | + $directives = "\t" . implode("\n\t", $this->directives->toArray()); |
|
68 | + return $this->selectorType . $this->selector . " {\n" . $directives . "\n}\n"; |
|
69 | 69 | } |
70 | 70 | } |
@@ -93,20 +93,20 @@ discard block |
||
93 | 93 | $textParts = []; |
94 | 94 | $terms = $variables = $haveVariables = $elementCount = 0; |
95 | 95 | foreach ($this->children as $child) { |
96 | - $elementCount++; |
|
96 | + $elementCount ++; |
|
97 | 97 | |
98 | 98 | if (($child instanceof Text) && in_array($child->getSource(), ['term', 'value'])) { |
99 | - ++$terms; |
|
99 | + ++ $terms; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | if (($child instanceof Label)) { |
103 | - ++$terms; |
|
103 | + ++ $terms; |
|
104 | 104 | } |
105 | 105 | if (method_exists($child, "getSource") && $child->getSource() == 'variable' |
106 | 106 | && !empty($child->getVariable()) && $child->getVariable() != "date" |
107 | 107 | && !empty($data->{$child->getVariable()}) |
108 | 108 | ) { |
109 | - ++$variables; |
|
109 | + ++ $variables; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | $text = $child->render($data, $citationNumber); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | "getVariable" |
131 | 131 | ) && $child->getVariable() != "date" && !empty($child->getVariable())) |
132 | 132 | ) { |
133 | - $haveVariables++; |
|
133 | + $haveVariables ++; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | if (method_exists($child, "getSource") && $child->getSource() == 'macro') { |
137 | - $haveVariables++; |
|
137 | + $haveVariables ++; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | } |
@@ -133,8 +133,8 @@ |
||
133 | 133 | public function renderNumeric() |
134 | 134 | { |
135 | 135 | $ret = $this->year; |
136 | - $ret .= $this->month > 0 && $this->month < 13 ? "-".sprintf("%02s", $this->month) : ""; |
|
137 | - $ret .= $this->day > 0 && $this->day < 32 ? "-".sprintf("%02s", $this->day) : ""; |
|
136 | + $ret .= $this->month > 0 && $this->month < 13 ? "-" . sprintf("%02s", $this->month) : ""; |
|
137 | + $ret .= $this->day > 0 && $this->day < 32 ? "-" . sprintf("%02s", $this->day) : ""; |
|
138 | 138 | return $ret; |
139 | 139 | } |
140 | 140 | } |