@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface |
| 202 | 202 | { |
| 203 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
| 203 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
| 204 | 204 | $notVirtual = false; |
| 205 | 205 | if (!$page->isVirtual()) { |
| 206 | 206 | $notVirtual = true; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | */ |
| 243 | 243 | public function sortByWeight(\Traversable $collection): array |
| 244 | 244 | { |
| 245 | - $callback = function ($a, $b) { |
|
| 245 | + $callback = function($a, $b) { |
|
| 246 | 246 | if (!isset($a['weight'])) { |
| 247 | 247 | $a['weight'] = 0; |
| 248 | 248 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function sortByDate(\Traversable $collection): array |
| 273 | 273 | { |
| 274 | - $callback = function ($a, $b) { |
|
| 274 | + $callback = function($a, $b) { |
|
| 275 | 275 | if ($a['date'] == $b['date']) { |
| 276 | 276 | return 0; |
| 277 | 277 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | $generatorManager = new GeneratorManager($this->builder); |
| 46 | 46 | |
| 47 | 47 | // loads local generators |
| 48 | - spl_autoload_register(function ($className) { |
|
| 48 | + spl_autoload_register(function($className) { |
|
| 49 | 49 | $generatorFile = Util::joinFile($this->config->getSourceDir(), 'generators', "$className.php"); |
| 50 | 50 | if (file_exists($generatorFile)) { |
| 51 | 51 | require $generatorFile; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | }); |
| 54 | 54 | |
| 55 | 55 | $generators = (array) $this->builder->getConfig()->get('generators'); |
| 56 | - array_walk($generators, function ($generator, $priority) use ($generatorManager) { |
|
| 56 | + array_walk($generators, function($generator, $priority) use ($generatorManager) { |
|
| 57 | 57 | if (!class_exists($generator)) { |
| 58 | 58 | $message = sprintf('Unable to load generator "%s"', $generator); |
| 59 | 59 | $this->builder->getLogger()->error($message); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public static function fileGetContents($filename, $userAgent = false) |
| 43 | 43 | { |
| 44 | 44 | set_error_handler( |
| 45 | - function ($severity, $message, $file, $line) { |
|
| 45 | + function($severity, $message, $file, $line) { |
|
| 46 | 46 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
| 47 | 47 | } |
| 48 | 48 | ); |
@@ -136,8 +136,8 @@ |
||
| 136 | 136 | case PageType::TERM: |
| 137 | 137 | $layouts = [ |
| 138 | 138 | // "taxonomy/$term.$format.$ext", // ie: taxonomy/velo.html.twig |
| 139 | - "_default/term.$format.$ext", // ie: _default/term.html.twig |
|
| 140 | - "_default/list.$format.$ext", // ie: _default/list.html.twig |
|
| 139 | + "_default/term.$format.$ext", // ie: _default/term.html.twig |
|
| 140 | + "_default/list.$format.$ext", // ie: _default/list.html.twig |
|
| 141 | 141 | ]; |
| 142 | 142 | if ($page->getVariable('term')) { |
| 143 | 143 | $layouts = array_merge( |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function generate(): void |
| 25 | 25 | { |
| 26 | - $subPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 26 | + $subPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 27 | 27 | return $page->getType() == TYPE::PAGE |
| 28 | 28 | && $page->isVirtual() === false // excludes virtual pages |
| 29 | 29 | && $page->getVariable('exclude') !== true; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function all(): self |
| 26 | 26 | { |
| 27 | - $filteredPages = $this->filter(function (Page $page) { |
|
| 27 | + $filteredPages = $this->filter(function(Page $page) { |
|
| 28 | 28 | if ($page->isVirtual() === false |
| 29 | 29 | && $page->getVariable('published') === true |
| 30 | 30 | && $page->getVariable('exclude') !== true) { |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function sortByDate(): self |
| 44 | 44 | { |
| 45 | - return $this->usort(function ($a, $b) { |
|
| 45 | + return $this->usort(function($a, $b) { |
|
| 46 | 46 | if ($a['date'] == $b['date']) { |
| 47 | 47 | return 0; |
| 48 | 48 | } |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | */ |
| 59 | 59 | public function sortByTitle(): self |
| 60 | 60 | { |
| 61 | - return $this->usort(function ($a, $b) { |
|
| 61 | + return $this->usort(function($a, $b) { |
|
| 62 | 62 | return strnatcmp($a['title'], $b['title']); |
| 63 | 63 | }); |
| 64 | 64 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function sortByWeight(): self |
| 72 | 72 | { |
| 73 | - return $this->usort(function ($a, $b) { |
|
| 73 | + return $this->usort(function($a, $b) { |
|
| 74 | 74 | if ($a['weight'] == $b['weight']) { |
| 75 | 75 | return 0; |
| 76 | 76 | } |
@@ -95,7 +95,7 @@ |
||
| 95 | 95 | protected function collectTermsFromPages() |
| 96 | 96 | { |
| 97 | 97 | /** @var Page $page */ |
| 98 | - $pages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 98 | + $pages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 99 | 99 | return $page->getVariable('published'); |
| 100 | 100 | })->sortByDate(); |
| 101 | 101 | foreach ($pages as $page) { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // filters pages: home, sections and terms |
| 32 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 32 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 33 | 33 | return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]); |
| 34 | 34 | }); |
| 35 | 35 | /** @var Page $page */ |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $paginationPath = $pagePagination['path']; |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | - $pages = $pages->filter(function (Page $page) { |
|
| 61 | + $pages = $pages->filter(function(Page $page) { |
|
| 62 | 62 | return $page->getVariable('published'); |
| 63 | 63 | }); |
| 64 | 64 | $pagesTotal = count($pages); |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | $this->url = new self($this->builder, $page, $options); |
| 116 | 116 | break; |
| 117 | 117 | // asset as string |
| 118 | - case false !== strpos($value, '.') ? true : false: |
|
| 119 | - $this->url = $base.'/'.ltrim($value, '/'); |
|
| 118 | + case false !== strpos($value, '.') ? true : false : $this->url = $base.'/'.ltrim($value, '/'); |
|
| 120 | 119 | break; |
| 121 | 120 | // others cases? |
| 122 | 121 | default: |