@@ -25,7 +25,7 @@ |
||
25 | 25 | $generatedPages = new PageCollection(); |
26 | 26 | |
27 | 27 | if (!$pageCollection->has('index')) { |
28 | - $filteredPages = $pageCollection->filter(function (Page $page) { |
|
28 | + $filteredPages = $pageCollection->filter(function(Page $page) { |
|
29 | 29 | return $page->getNodeType() === null |
30 | 30 | && $page->getSection() == $this->config->get('site.paginate.homepage.section') |
31 | 31 | && !empty($page->getBody()); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | public function usort(\Closure $callback = null) |
167 | 167 | { |
168 | 168 | $items = $this->items; |
169 | - $callback ? uasort($items, $callback) : uasort($items, function ($a, $b) { |
|
169 | + $callback ? uasort($items, $callback) : uasort($items, function($a, $b) { |
|
170 | 170 | if ($a == $b) { |
171 | 171 | return 0; |
172 | 172 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function sortByDate() |
186 | 186 | { |
187 | - return $this->usort(function ($a, $b) { |
|
187 | + return $this->usort(function($a, $b) { |
|
188 | 188 | if (!isset($a['date'])) { |
189 | 189 | return -1; |
190 | 190 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function filterBy($pages, $variable, $value) |
115 | 115 | { |
116 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
116 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
117 | 117 | // filter virtual pages in section |
118 | 118 | if ($variable == 'section' && $page->getVariable('virtual')) { |
119 | 119 | return false; |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function sortByWeight($array) |
161 | 161 | { |
162 | - $callback = function ($a, $b) { |
|
162 | + $callback = function($a, $b) { |
|
163 | 163 | if (!isset($a['weight'])) { |
164 | 164 | return 1; |
165 | 165 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function sortByDate($array) |
194 | 194 | { |
195 | - $callback = function ($a, $b) { |
|
195 | + $callback = function($a, $b) { |
|
196 | 196 | if (!isset($a['date'])) { |
197 | 197 | return -1; |
198 | 198 | } |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $staticDir = $this->phpoole->getConfig()->getStaticPath(); |
62 | 62 | if (Util::getFS()->exists($staticDir)) { |
63 | 63 | $finder = new Finder(); |
64 | - $finder->files()->filter(function (\SplFileInfo $file) { |
|
64 | + $finder->files()->filter(function(\SplFileInfo $file) { |
|
65 | 65 | return !(is_array($this->phpoole->getConfig()->get('static.exclude')) |
66 | 66 | && in_array($file->getBasename(), $this->phpoole->getConfig()->get('static.exclude'))); |
67 | 67 | })->in($staticDir); |
@@ -46,7 +46,7 @@ |
||
46 | 46 | call_user_func_array($this->phpoole->getMessageCb(), ['SAVE', 'Saving pages']); |
47 | 47 | |
48 | 48 | /* @var $page Page */ |
49 | - $filteredPages = $this->phpoole->getPages()->filter(function (Page $page) { |
|
49 | + $filteredPages = $this->phpoole->getPages()->filter(function(Page $page) { |
|
50 | 50 | return !empty($page->getVariable('rendered')); |
51 | 51 | }); |
52 | 52 | $max = count($filteredPages); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | if ($this->process) { |
34 | 34 | $generatorManager = new GeneratorManager(); |
35 | 35 | $generators = $this->phpoole->getConfig()->get('generators'); |
36 | - array_walk($generators, function ($generator, $priority) use ($generatorManager) { |
|
36 | + array_walk($generators, function($generator, $priority) use ($generatorManager) { |
|
37 | 37 | if (!class_exists($generator)) { |
38 | 38 | $message = sprintf("Unable to load generator '%s'", $generator); |
39 | 39 | call_user_func_array($this->phpoole->getMessageCb(), ['GENERATE_ERROR', $message]); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // collect published pages |
54 | 54 | /* @var $page Page */ |
55 | - $filteredPages = $this->phpoole->getPages()->filter(function (Page $page) { |
|
55 | + $filteredPages = $this->phpoole->getPages()->filter(function(Page $page) { |
|
56 | 56 | return !empty($page->getVariable('published')); |
57 | 57 | }); |
58 | 58 | $max = count($filteredPages); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $this->phpoole->getRenderer()->addGlobal('site', array_merge( |
112 | 112 | $this->config->get('site'), |
113 | 113 | ['menus' => $this->phpoole->getMenus()], |
114 | - ['pages' => $this->phpoole->getPages()->filter(function (Page $page) { |
|
114 | + ['pages' => $this->phpoole->getPages()->filter(function(Page $page) { |
|
115 | 115 | return $page->getVariable('published'); |
116 | 116 | })], |
117 | 117 | ['time' => time()] |
@@ -142,7 +142,7 @@ |
||
142 | 142 | /** |
143 | 143 | * Apply environment variables. |
144 | 144 | */ |
145 | - $applyEnv = function ($array) use ($data) { |
|
145 | + $applyEnv = function($array) use ($data) { |
|
146 | 146 | $iterator = new \RecursiveIteratorIterator( |
147 | 147 | new \RecursiveArrayIterator($array), |
148 | 148 | \RecursiveIteratorIterator::SELF_FIRST |