@@ -86,13 +86,12 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if (CiteProc::getContext()->isModeBibliography()) { |
| 89 | - foreach ($data as $citationNumber => $item) { |
|
| 90 | - ++self::$numberOfCitedItems; |
|
| 89 | + foreach ($data as $citationNumber => $item) {++self::$numberOfCitedItems; |
|
| 91 | 90 | CiteProc::getContext()->getResults()->append($this->wrapBibEntry($item, $this->renderSingle($item, $citationNumber))); |
| 92 | 91 | } |
| 93 | 92 | $ret .= implode($this->delimiter, CiteProc::getContext()->getResults()->toArray()); |
| 94 | 93 | $ret = StringHelper::clearApostrophes($ret); |
| 95 | - return "<div class=\"csl-bib-body\">" . $ret . "\n</div>"; |
|
| 94 | + return "<div class=\"csl-bib-body\">".$ret."\n</div>"; |
|
| 96 | 95 | |
| 97 | 96 | } else if (CiteProc::getContext()->isModeCitation()) { |
| 98 | 97 | if ($citationItems->count() > 0) { //is there a filter for specific citations? |
@@ -140,9 +139,9 @@ discard block |
||
| 140 | 139 | |
| 141 | 140 | if (!empty($inMargin) && !empty($margin) && CiteProc::getContext()->isModeBibliography()) { |
| 142 | 141 | $leftMargin = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $inMargin)))); |
| 143 | - $rightInline = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $margin))) . $this->suffix); |
|
| 144 | - $res = '<div class="csl-left-margin">' . $leftMargin . '</div>'; |
|
| 145 | - $res .= '<div class="csl-right-inline">' . $rightInline . '</div>'; |
|
| 142 | + $rightInline = $this->removeConsecutiveChars($this->htmlentities($this->format(implode("", $margin))).$this->suffix); |
|
| 143 | + $res = '<div class="csl-left-margin">'.$leftMargin.'</div>'; |
|
| 144 | + $res .= '<div class="csl-right-inline">'.$rightInline.'</div>'; |
|
| 146 | 145 | return $res; |
| 147 | 146 | } else if (!empty($inMargin)) { |
| 148 | 147 | $res = $this->format(implode("", $inMargin)); |
@@ -166,9 +165,9 @@ discard block |
||
| 166 | 165 | private function wrapBibEntry($dataItem, $value) |
| 167 | 166 | { |
| 168 | 167 | $value = $this->addAffixes($value); |
| 169 | - return "\n " . |
|
| 170 | - "<div class=\"csl-entry\">" . |
|
| 171 | - $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value) . |
|
| 168 | + return "\n ". |
|
| 169 | + "<div class=\"csl-entry\">". |
|
| 170 | + $renderedItem = CiteProcHelper::applyAdditionMarkupFunction($dataItem, "csl-entry", $value). |
|
| 172 | 171 | "</div>"; |
| 173 | 172 | } |
| 174 | 173 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | array_walk($parts, function($part) use (&$className) { |
| 36 | 36 | $className .= ucfirst($part); |
| 37 | 37 | }); |
| 38 | - $className = self::NAMESPACE_CONSTRAINTS . $className; |
|
| 38 | + $className = self::NAMESPACE_CONSTRAINTS.$className; |
|
| 39 | 39 | |
| 40 | 40 | if (!class_exists($className)) { |
| 41 | 41 | throw new ClassNotFoundException($className); |
@@ -39,13 +39,13 @@ |
||
| 39 | 39 | $attr = ""; |
| 40 | 40 | for ($i = count($nameParts) - 1; $i >= 0; --$i) { |
| 41 | 41 | if ($i > 0) { |
| 42 | - $attr = ucfirst($nameParts[$i]) . $attr; |
|
| 42 | + $attr = ucfirst($nameParts[$i]).$attr; |
|
| 43 | 43 | } else { |
| 44 | - $attr = $nameParts[$i] . $attr; |
|
| 44 | + $attr = $nameParts[$i].$attr; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | if (!isset($this->{$attr})) { |
| 48 | - throw new \InvalidArgumentException("Property \"$attr\" ($name) does not exist in " . __CLASS__); |
|
| 48 | + throw new \InvalidArgumentException("Property \"$attr\" ($name) does not exist in ".__CLASS__); |
|
| 49 | 49 | } |
| 50 | 50 | $this->{$attr} = $value; |
| 51 | 51 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | if (!in_array($this->display, self::$allowedValues)) { |
| 56 | 56 | return $text; |
| 57 | 57 | } |
| 58 | - $divStyle = "class=\"csl-" . $this->display . "\""; |
|
| 58 | + $divStyle = "class=\"csl-".$this->display."\""; |
|
| 59 | 59 | return "<div $divStyle>$text</div>"; |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | \ No newline at end of file |
@@ -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 | $res = preg_replace($pattern, $punctuationSign, $subject); |
| 48 | 48 | return $res; |
@@ -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 | } |
| 71 | 71 | \ No newline at end of file |
@@ -60,11 +60,11 @@ |
||
| 60 | 60 | if ($lineSpacing || $entrySpacing || $hangingIndent) { |
| 61 | 61 | $rule = $this->cssRules->getRule(".csl-entry"); |
| 62 | 62 | if (!empty($lineSpacing)) { |
| 63 | - $rule->addDirective("line-height", intval($lineSpacing) . "em"); |
|
| 63 | + $rule->addDirective("line-height", intval($lineSpacing)."em"); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | if (!empty($entrySpacing)) { |
| 67 | - $rule->addDirective("margin-bottom", intval($entrySpacing) . "em"); |
|
| 67 | + $rule->addDirective("margin-bottom", intval($entrySpacing)."em"); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (!empty($hangingIndent)) { |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | if (!empty($format)) { |
| 93 | - $text = '<span style="' . $format . '">' . $text . '</span>'; |
|
| 93 | + $text = '<span style="'.$format.'">'.$text.'</span>'; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | return $text; |
@@ -84,12 +84,12 @@ |
||
| 84 | 84 | $lastChar = mb_substr($text, -1, 1); |
| 85 | 85 | if ($closeQuote === $lastChar) { // last char is closing quote? |
| 86 | 86 | $text = mb_substr($text, 0, mb_strlen($text) - 1); //set suffix before |
| 87 | - return $text . $suffix . $lastChar; |
|
| 87 | + return $text.$suffix.$lastChar; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | - return $prefix . $text . $suffix; |
|
| 92 | + return $prefix.$text.$suffix; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |