@@ -146,7 +146,7 @@ |
||
146 | 146 | */ |
147 | 147 | protected function collectPages(): void |
148 | 148 | { |
149 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
149 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
150 | 150 | return $page->hasVariable('menu') |
151 | 151 | && $page->getVariable('published') |
152 | 152 | && in_array($page->getVariable('language', $this->config->getLanguageDefault()), array_column($this->config->getLanguages(), 'code')); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $this->generate(); |
51 | 51 | |
52 | 52 | // set default language (e.g.: "en") if necessary |
53 | - $this->generatedPages->map(function (\Cecil\Collection\Page\Page $page) { |
|
53 | + $this->generatedPages->map(function(\Cecil\Collection\Page\Page $page) { |
|
54 | 54 | if ($page->getVariable('language') === null) { |
55 | 55 | $page->setVariable('language', $this->config->getLanguageDefault()); |
56 | 56 | } |
@@ -136,7 +136,7 @@ |
||
136 | 136 | */ |
137 | 137 | public function getPages(): \Cecil\Collection\Page\Collection |
138 | 138 | { |
139 | - return $this->builder->getPages()->filter(function (CollectionPage $page) { |
|
139 | + return $this->builder->getPages()->filter(function(CollectionPage $page) { |
|
140 | 140 | // We should fix case of virtual pages without language |
141 | 141 | if ($page->getVariable('language') === null && $this->language == $this->config->getLanguageDefault()) { |
142 | 142 | return true; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $page = clone $this->builder->getPages()->get($pageId); |
42 | 42 | } |
43 | 43 | // collects all pages |
44 | - $subPages = $this->builder->getPages()->filter(function (Page $page) use ($language) { |
|
44 | + $subPages = $this->builder->getPages()->filter(function(Page $page) use ($language) { |
|
45 | 45 | return $page->getType() == TYPE::PAGE |
46 | 46 | && $page->isVirtual() === false |
47 | 47 | && $page->getVariable('exclude') !== true |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface |
212 | 212 | { |
213 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
213 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
214 | 214 | $notVirtual = false; |
215 | 215 | if (!$page->isVirtual()) { |
216 | 216 | $notVirtual = true; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | */ |
246 | 246 | public function sortByWeight(\Traversable $collection): array |
247 | 247 | { |
248 | - $callback = function ($a, $b) { |
|
248 | + $callback = function($a, $b) { |
|
249 | 249 | if (!isset($a['weight'])) { |
250 | 250 | $a['weight'] = 0; |
251 | 251 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function sortByDate(\Traversable $collection, string $variable = 'date'): array |
273 | 273 | { |
274 | - $callback = function ($a, $b) use ($variable) { |
|
274 | + $callback = function($a, $b) use ($variable) { |
|
275 | 275 | if ($a[$variable] == $b[$variable]) { |
276 | 276 | return 0; |
277 | 277 | } |
@@ -76,10 +76,10 @@ |
||
76 | 76 | // i18n |
77 | 77 | $this->twig->addExtension(new IntlExtension()); |
78 | 78 | // filters fallback |
79 | - $this->twig->registerUndefinedFilterCallback(function ($name) { |
|
79 | + $this->twig->registerUndefinedFilterCallback(function($name) { |
|
80 | 80 | switch ($name) { |
81 | 81 | case 'localizeddate': |
82 | - return new \Twig\TwigFilter($name, function (\DateTime $value = null) { |
|
82 | + return new \Twig\TwigFilter($name, function(\DateTime $value = null) { |
|
83 | 83 | return date((string) $this->builder->getConfig()->get('date.format'), $value->getTimestamp()); |
84 | 84 | }); |
85 | 85 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function showable(): self |
27 | 27 | { |
28 | - return $this->filter(function (Page $page) { |
|
28 | + return $this->filter(function(Page $page) { |
|
29 | 29 | if ($page->getVariable('published') === true |
30 | 30 | && $page->isVirtual() === false |
31 | 31 | && $page->getVariable('redirect') === null |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function sortByDate(): self |
50 | 50 | { |
51 | - return $this->usort(function ($a, $b) { |
|
51 | + return $this->usort(function($a, $b) { |
|
52 | 52 | if ($a['date'] == $b['date']) { |
53 | 53 | return 0; |
54 | 54 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function sortByTitle(): self |
64 | 64 | { |
65 | - return $this->usort(function ($a, $b) { |
|
65 | + return $this->usort(function($a, $b) { |
|
66 | 66 | return strnatcmp($a['title'], $b['title']); |
67 | 67 | }); |
68 | 68 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function sortByWeight(): self |
74 | 74 | { |
75 | - return $this->usort(function ($a, $b) { |
|
75 | + return $this->usort(function($a, $b) { |
|
76 | 76 | if ($a['weight'] == $b['weight']) { |
77 | 77 | return 0; |
78 | 78 | } |