@@ -78,7 +78,7 @@ |
||
78 | 78 | * Apply environment variables. |
79 | 79 | */ |
80 | 80 | $data = $this->getData(); |
81 | - $applyEnv = function ($array) use ($data) { |
|
81 | + $applyEnv = function($array) use ($data) { |
|
82 | 82 | $iterator = new \RecursiveIteratorIterator( |
83 | 83 | new \RecursiveArrayIterator($array), |
84 | 84 | \RecursiveIteratorIterator::SELF_FIRST |
@@ -179,7 +179,7 @@ |
||
179 | 179 | */ |
180 | 180 | public function messageCallback(OutputInterface $output) |
181 | 181 | { |
182 | - return function ($code, $message = '', $itemsCount = 0, $itemsMax = 0) use ($output) { |
|
182 | + return function($code, $message = '', $itemsCount = 0, $itemsMax = 0) use ($output) { |
|
183 | 183 | if (strpos($code, '_PROGRESS') !== false) { |
184 | 184 | if ($output->isVerbose()) { |
185 | 185 | if ($itemsCount > 0) { |
@@ -67,7 +67,7 @@ |
||
67 | 67 | foreach ($files as $file) { |
68 | 68 | $count++; |
69 | 69 | set_error_handler( |
70 | - function ($severity, $message, $file, $line) { |
|
70 | + function($severity, $message, $file, $line) { |
|
71 | 71 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
72 | 72 | } |
73 | 73 | ); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | $dataDir = (string) $this->getBuilder($output)->getConfig()->get('data.dir'); |
48 | 48 | |
49 | 49 | // format output |
50 | - $unicodeTreePrefix = function (RecursiveTreeIterator $tree) { |
|
50 | + $unicodeTreePrefix = function(RecursiveTreeIterator $tree) { |
|
51 | 51 | $prefixParts = [ |
52 | 52 | RecursiveTreeIterator::PREFIX_LEFT => ' ', |
53 | 53 | RecursiveTreeIterator::PREFIX_MID_HAS_NEXT => '│ ', |
@@ -36,7 +36,7 @@ |
||
36 | 36 | call_user_func_array($this->builder->getMessageCb(), ['GENERATE', 'Generating pages']); |
37 | 37 | |
38 | 38 | $generators = (array) $this->builder->getConfig()->get('generators'); |
39 | - array_walk($generators, function ($generator, $priority) use ($generatorManager) { |
|
39 | + array_walk($generators, function($generator, $priority) use ($generatorManager) { |
|
40 | 40 | if (!class_exists($generator)) { |
41 | 41 | $message = sprintf('Unable to load generator "%s"', $generator); |
42 | 42 | call_user_func_array($this->builder->getMessageCb(), ['GENERATE_ERROR', $message]); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | // filter pages: home, sections and terms |
30 | - $filteredPages = $this->pagesCollection->filter(function (Page $page) { |
|
30 | + $filteredPages = $this->pagesCollection->filter(function(Page $page) { |
|
31 | 31 | return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]); |
32 | 32 | }); |
33 | 33 | /** @var Page $page */ |
@@ -44,7 +44,7 @@ |
||
44 | 44 | $message = sprintf('"%s" theme: no config file', $theme); |
45 | 45 | if (Util::getFS()->exists($themeConfigFile)) { |
46 | 46 | set_error_handler( |
47 | - function ($severity, $message, $file, $line) { |
|
47 | + function($severity, $message, $file, $line) { |
|
48 | 48 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
49 | 49 | } |
50 | 50 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function all(): self |
22 | 22 | { |
23 | - $filteredPages = $this->filter(function (Page $page) { |
|
23 | + $filteredPages = $this->filter(function(Page $page) { |
|
24 | 24 | if ($page->isVirtual() === false) { |
25 | 25 | return true; |
26 | 26 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function sortByDate(): self |
38 | 38 | { |
39 | - return $this->usort(function ($a, $b) { |
|
39 | + return $this->usort(function($a, $b) { |
|
40 | 40 | if (!isset($a['date'])) { |
41 | 41 | return -1; |
42 | 42 | } |
@@ -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 (!isset($a['weight'])) { |
75 | 75 | return 1; |
76 | 76 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | // collect published pages |
57 | 57 | /* @var $page Page */ |
58 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
58 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
59 | 59 | return !empty($page->getVariable('published')); |
60 | 60 | }); |
61 | 61 | $max = count($filteredPages); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | // https://regex101.com/r/dZ02zO/5 |
268 | 268 | $rendered = preg_replace_callback( |
269 | 269 | '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is', |
270 | - function ($matches) { |
|
270 | + function($matches) { |
|
271 | 271 | return \sprintf('href="../%s/%s"', Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? ''); |
272 | 272 | }, |
273 | 273 | $rendered |