@@ -106,7 +106,7 @@ |
||
106 | 106 | $count = 0; |
107 | 107 | |
108 | 108 | $filteredPages = $this->builder->getPages() |
109 | - ->filter(function (Page $page) { |
|
109 | + ->filter(function(Page $page) { |
|
110 | 110 | if ($page->getVariable('menu')) { |
111 | 111 | return true; |
112 | 112 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | // collect published pages |
55 | 55 | /* @var $page Page */ |
56 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
56 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
57 | 57 | return !empty($page->getVariable('published')); |
58 | 58 | }); |
59 | 59 | $max = count($filteredPages); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | public function getPages() |
92 | 92 | { |
93 | - return $this->builder->getPages()->filter(function (Page $page) { |
|
93 | + return $this->builder->getPages()->filter(function(Page $page) { |
|
94 | 94 | return $page->getVariable('published'); |
95 | 95 | }); |
96 | 96 | } |
@@ -93,7 +93,7 @@ |
||
93 | 93 | // https://regex101.com/r/dZ02zO/5 |
94 | 94 | $this->rendered = preg_replace_callback( |
95 | 95 | '/href="([A-Za-z0-9_\.\-\/]+)\.md(\#[A-Za-z0-9\-]+)?"/is', |
96 | - function ($matches) { |
|
96 | + function($matches) { |
|
97 | 97 | return \sprintf('href="../%s%s"', Page::slugify(PrefixSuffix::sub($matches[1])), $matches[2] ?? ''); |
98 | 98 | }, |
99 | 99 | $this->rendered |
@@ -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 | ); |
@@ -72,7 +72,7 @@ |
||
72 | 72 | } |
73 | 73 | // save thumb file |
74 | 74 | $img = Image::make($this->config->getStaticPath().'/'.$image['element']['attributes']['src']); |
75 | - $img->resize($resize, null, function (\Intervention\Image\Constraint $constraint) { |
|
75 | + $img->resize($resize, null, function(\Intervention\Image\Constraint $constraint) { |
|
76 | 76 | $constraint->aspectRatio(); |
77 | 77 | $constraint->upsize(); |
78 | 78 | }); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface |
137 | 137 | { |
138 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
138 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
139 | 139 | $notVirtual = false; |
140 | 140 | // not virtual only |
141 | 141 | if (!$page->isVirtual()) { |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function sortByWeight($collection): array |
184 | 184 | { |
185 | - $callback = function ($a, $b) { |
|
185 | + $callback = function($a, $b) { |
|
186 | 186 | if (!isset($a['weight'])) { |
187 | 187 | return 1; |
188 | 188 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | public function sortByDate($collection): array |
217 | 217 | { |
218 | - $callback = function ($a, $b) { |
|
218 | + $callback = function($a, $b) { |
|
219 | 219 | if (!isset($a['date'])) { |
220 | 220 | return -1; |
221 | 221 | } |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } |
575 | 575 | // save thumb file |
576 | 576 | $img = Image::make($this->config->getStaticPath().'/'.$path); |
577 | - $img->resize($size, null, function (\Intervention\Image\Constraint $constraint) { |
|
577 | + $img->resize($size, null, function(\Intervention\Image\Constraint $constraint) { |
|
578 | 578 | $constraint->aspectRatio(); |
579 | 579 | $constraint->upsize(); |
580 | 580 | }); |