@@ -35,13 +35,13 @@ |
||
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Test. |
|
| 40 | - * |
|
| 41 | - * @dataProvider providerTextWithLinks |
|
| 42 | - * |
|
| 43 | - * @return void |
|
| 44 | - */ |
|
| 38 | + /** |
|
| 39 | + * Test. |
|
| 40 | + * |
|
| 41 | + * @dataProvider providerTextWithLinks |
|
| 42 | + * |
|
| 43 | + * @return void |
|
| 44 | + */ |
|
| 45 | 45 | public function testAddBaseurlToRelativeLinks($baseurl, $text, $exp) |
| 46 | 46 | { |
| 47 | 47 | $filter = new TextFilter(); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $filter = new TextFilter(); |
| 48 | 48 | |
| 49 | - $callback = function ($url, $baseurl) { |
|
| 49 | + $callback = function($url, $baseurl) { |
|
| 50 | 50 | return rtrim("$baseurl/$url", "/"); |
| 51 | 51 | }; |
| 52 | 52 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | return preg_replace_callback( |
| 49 | 49 | $patterns, |
| 50 | - function ($matches) { |
|
| 50 | + function($matches) { |
|
| 51 | 51 | switch ($matches[1]) { |
| 52 | 52 | case "FIGURE": |
| 53 | 53 | return self::shortCodeFigure($matches[2]); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $res[$match] = true; |
| 131 | 131 | } else { |
| 132 | 132 | $key = substr($match, 0, $pos); |
| 133 | - $val = trim(substr($match, $pos+1), '"'); |
|
| 133 | + $val = trim(substr($match, $pos + 1), '"'); |
|
| 134 | 134 | $res[$key] = $val; |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public static function shortCodeYoutube($options) |
| 153 | 153 | { |
| 154 | - $options= array_merge( |
|
| 154 | + $options = array_merge( |
|
| 155 | 155 | [ |
| 156 | 156 | "id" => null, |
| 157 | 157 | "class" => null, |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $class = $class ? " class=\"figure $class\"" : " class=\"figure\""; |
| 171 | 171 | $list = $list ? "?listType=playlist&list=$list" : null; |
| 172 | 172 | $time = $time ? "#t=$time" : null; |
| 173 | - $height = ceil($width / $ratio); |
|
| 173 | + $height = ceil($width/$ratio); |
|
| 174 | 174 | |
| 175 | 175 | //$caption = t("Figure: !CAPTION", ["!CAPTION" => $caption]); |
| 176 | 176 | if ($caption) { |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public static function shortCodeCodepen($options) |
| 204 | 204 | { |
| 205 | - $options= array_merge( |
|
| 205 | + $options = array_merge( |
|
| 206 | 206 | [ |
| 207 | 207 | "id" => null, |
| 208 | 208 | "class" => null, |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | public static function shortCodeFigure($options) |
| 255 | 255 | { |
| 256 | 256 | // Merge incoming options with default and expose as variables |
| 257 | - $options= array_merge( |
|
| 257 | + $options = array_merge( |
|
| 258 | 258 | [ |
| 259 | 259 | "id" => null, |
| 260 | 260 | "class" => null, |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | public static function shortCodeAsciinema($options) |
| 316 | 316 | { |
| 317 | 317 | // Merge incoming options with default and expose as variables |
| 318 | - $options= array_merge( |
|
| 318 | + $options = array_merge( |
|
| 319 | 319 | [ |
| 320 | 320 | "id" => null, |
| 321 | 321 | "class" => null, |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | public static function shortCodeBook($options) |
| 354 | 354 | { |
| 355 | 355 | // Merge incoming options with default and expose as variables |
| 356 | - $options= array_merge( |
|
| 356 | + $options = array_merge( |
|
| 357 | 357 | [ |
| 358 | 358 | "isbn" => null, |
| 359 | 359 | ], |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $text = str_replace(array("\r\n", "\r"), "\n", $text); |
| 90 | 90 | $this->lines = explode("\n", $text); |
| 91 | 91 | $this->lineNumber = 0; |
| 92 | - $this->linesRemoved = 0; // Only needed for log? |
|
| 92 | + $this->linesRemoved = 0; // Only needed for log? |
|
| 93 | 93 | $this->frontmatter = $frontmatter; |
| 94 | 94 | |
| 95 | 95 | return $this->parseLines(); |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | // Check if line is matching a detected blocktype |
| 149 | 149 | foreach ($blockTypes as $blockType) { |
| 150 | - if ($this->{"block".$blockType}($line)) { |
|
| 150 | + if ($this->{"block" . $blockType}($line)) { |
|
| 151 | 151 | continue; |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | if ($this->config["include"] |
| 205 | 205 | && preg_match("/^#include[ \t]([\w.]+)$/", $line, $matches) |
| 206 | 206 | ) { |
| 207 | - $file = $this->config["include_base"]."/".$matches[1]; |
|
| 207 | + $file = $this->config["include_base"] . "/" . $matches[1]; |
|
| 208 | 208 | |
| 209 | 209 | if (!is_readable($file)) { |
| 210 | 210 | throw new Exception("Could not find include file: '$file'"); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | $text = implode("\n", $lines); |
| 416 | - $parsed = json_decode($text."\n", true); |
|
| 416 | + $parsed = json_decode($text . "\n", true); |
|
| 417 | 417 | |
| 418 | 418 | if (is_null($parsed)) { |
| 419 | 419 | throw new Exception("Failed parsing JSON frontmatter."); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | - * Wrap content of a HTML element with start and end. |
|
| 72 | + * Wrap content of a HTML element with start and end. |
|
| 73 | 73 | * |
| 74 | 74 | * @param string $text with content |
| 75 | 75 | * @param string $tag HTML tag to search for |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | return preg_replace_callback( |
| 166 | 166 | $pattern, |
| 167 | - function ($matches) use ($baseurl, $callback) { |
|
| 167 | + function($matches) use ($baseurl, $callback) { |
|
| 168 | 168 | $url = $callback($matches[2], $baseurl); |
| 169 | 169 | return "<a${matches[1]}href=\"$url\"${matches[3]}>"; |
| 170 | 170 | }, |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | return preg_replace_callback( |
| 191 | 191 | $pattern, |
| 192 | - function ($matches) use ($baseurl, $callback) { |
|
| 192 | + function($matches) use ($baseurl, $callback) { |
|
| 193 | 193 | $url = $callback($matches[2], $baseurl); |
| 194 | 194 | return "<img${matches[1]}src=\"$url\"${matches[3]}>"; |
| 195 | 195 | }, |
@@ -37,13 +37,13 @@ discard block |
||
| 37 | 37 | // @deprecated after 1.2 |
| 38 | 38 | "jsonfrontmatter" => "", // @deprecated replaced with frontmatter since 1.2 |
| 39 | 39 | "yamlfrontmatter" => "", // @deprecated replaced with frontmatter since 1.2 |
| 40 | - ]; |
|
| 40 | + ]; |
|
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Current document parsed. |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * Current document parsed. |
|
| 46 | + */ |
|
| 47 | 47 | private $current; |
| 48 | 48 | |
| 49 | 49 | |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | * |
| 588 | 588 | * @return string the formatted text. |
| 589 | 589 | */ |
| 590 | - /* |
|
| 590 | + /* |
|
| 591 | 591 | public function syntaxHighlightGeSHi($text, $language = "text") |
| 592 | 592 | { |
| 593 | 593 | $language = $language ?: "text"; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | { |
| 571 | 571 | return preg_replace_callback( |
| 572 | 572 | '#\b(?<![href|src]=[\'"])https?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#', |
| 573 | - function ($matches) { |
|
| 573 | + function($matches) { |
|
| 574 | 574 | return "<a href='{$matches[0]}'>{$matches[0]}</a>"; |
| 575 | 575 | }, |
| 576 | 576 | $text |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | */ |
| 648 | 648 | public function purify($text) |
| 649 | 649 | { |
| 650 | - $config = \HTMLPurifier_Config::createDefault(); |
|
| 650 | + $config = \HTMLPurifier_Config::createDefault(); |
|
| 651 | 651 | $config->set("Cache.DefinitionImpl", null); |
| 652 | 652 | //$config->set('Cache.SerializerPath', '/home/user/absolute/path'); |
| 653 | 653 | |
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | "view" => [ |
| 8 | 8 | "active" => false, |
| 9 | 9 | "shared" => true, |
| 10 | - "callback" => function () { |
|
| 10 | + "callback" => function() { |
|
| 11 | 11 | $view = new \Anax\View\ViewCollection(); |
| 12 | 12 | $view->setDI($this); |
| 13 | 13 | |
@@ -18,23 +18,23 @@ |
||
| 18 | 18 | { |
| 19 | 19 | return [ |
| 20 | 20 | [ |
| 21 | - [ null ], |
|
| 21 | + [null], |
|
| 22 | 22 | "class=\"\"", |
| 23 | 23 | ], |
| 24 | 24 | [ |
| 25 | - [ "a" ], |
|
| 25 | + ["a"], |
|
| 26 | 26 | "class=\"a\"", |
| 27 | 27 | ], |
| 28 | 28 | [ |
| 29 | - [ "a", "b" ], |
|
| 29 | + ["a", "b"], |
|
| 30 | 30 | "class=\"a b\"", |
| 31 | 31 | ], |
| 32 | 32 | [ |
| 33 | - [ "a", "b", ["c", "d"] ], |
|
| 33 | + ["a", "b", ["c", "d"]], |
|
| 34 | 34 | "class=\"a b c d\"", |
| 35 | 35 | ], |
| 36 | 36 | [ |
| 37 | - [ [], "a" ], |
|
| 37 | + [[], "a"], |
|
| 38 | 38 | "class=\"a\"", |
| 39 | 39 | ], |
| 40 | 40 | ]; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | public function testAddViewCheckRenderData() |
| 34 | 34 | { |
| 35 | 35 | $view = new View(); |
| 36 | - $template = function ($data) { |
|
| 36 | + $template = function($data) { |
|
| 37 | 37 | $str1 = $data["str1"] ?? null; |
| 38 | 38 | $str2 = $data["str2"] ?? null; |
| 39 | 39 | return "$str1, $str2:"; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public function testAddViewsCheckRenderData() |
| 58 | 58 | { |
| 59 | - $template = function ($data) { |
|
| 59 | + $template = function($data) { |
|
| 60 | 60 | $str1 = $data["str1"] ?? null; |
| 61 | 61 | $str2 = $data["str2"] ?? null; |
| 62 | 62 | return "$str1, $str2:"; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function testAddViewMergeData() |
| 90 | 90 | { |
| 91 | - $template = function ($data) { |
|
| 91 | + $template = function($data) { |
|
| 92 | 92 | $str1 = $data["str1"] ?? null; |
| 93 | 93 | $str2 = $data["str2"] ?? null; |
| 94 | 94 | return "$str1, $str2:"; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function testAddViewMergeDataWithArray() |
| 122 | 122 | { |
| 123 | - $template = function ($data) { |
|
| 123 | + $template = function($data) { |
|
| 124 | 124 | $str1 = $data["str1"] ?? null; |
| 125 | 125 | $str2 = $data["str2"] ?? null; |
| 126 | 126 | $str3a = $data["str3"]["a"] ?? null; |
@@ -27,9 +27,12 @@ |
||
| 27 | 27 | <div class="next"> |
| 28 | 28 | <?php if ($nextPageUrl) : ?> |
| 29 | 29 | <a href="<?= $this->url($nextPageUrl) ?>"><?= $nextStr ?></a> |
| 30 | - <?php else : ?> |
|
| 30 | + <?php else { |
|
| 31 | + : ?> |
|
| 31 | 32 | |
| 32 | - <?php endif; ?> |
|
| 33 | + <?php endif; |
|
| 34 | +} |
|
| 35 | +?> |
|
| 33 | 36 | </div> |
| 34 | 37 | |
| 35 | 38 | <div class="center"> |