@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | // collect published pages |
| 54 | 54 | /* @var $page Page */ |
| 55 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 55 | + $filteredPages = $this->builder->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->builder->getRenderer()->addGlobal('site', array_merge( |
| 112 | 112 | $this->config->get('site'), |
| 113 | 113 | ['menus' => $this->builder->getMenus()], |
| 114 | - ['pages' => $this->builder->getPages()->filter(function (Page $page) { |
|
| 114 | + ['pages' => $this->builder->getPages()->filter(function(Page $page) { |
|
| 115 | 115 | return $page->getVariable('published'); |
| 116 | 116 | })], |
| 117 | 117 | ['time' => time()] |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | call_user_func_array($this->builder->getMessageCb(), ['SAVE', 'Saving pages']); |
| 47 | 47 | |
| 48 | 48 | /* @var $page Page */ |
| 49 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 49 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 50 | 50 | return !empty($page->getVariable('rendered')); |
| 51 | 51 | }); |
| 52 | 52 | $max = count($filteredPages); |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $staticDir = $this->builder->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->builder->getConfig()->get('static.exclude')) |
| 66 | 66 | && in_array($file->getBasename(), $this->builder->getConfig()->get('static.exclude'))); |
| 67 | 67 | })->in($staticDir); |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | $themeConfigFile = $this->config->getThemesPath().'/'.$theme.'/'.self::THEME_CONFIG_FILE; |
| 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, $severity, $severity, $file, $line); |
| 49 | 49 | } |
| 50 | 50 | ); |
@@ -20,6 +20,7 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @param string|array $templatesPath |
| 22 | 22 | * @param Builder $buider |
| 23 | + * @return void |
|
| 23 | 24 | */ |
| 24 | 25 | public function __construct($templatesPath, Builder $buider); |
| 25 | 26 | |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | * |
| 39 | 39 | * @param string $string |
| 40 | 40 | * |
| 41 | - * @return string[]|null |
|
| 41 | + * @return string|null |
|
| 42 | 42 | */ |
| 43 | 43 | public static function getPrefix(string $string): ?string |
| 44 | 44 | { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function filterBy(PagesCollection $pages, string $variable, string $value): CollectionInterface |
| 128 | 128 | { |
| 129 | - $filteredPages = $pages->filter(function (Page $page) use ($variable, $value) { |
|
| 129 | + $filteredPages = $pages->filter(function(Page $page) use ($variable, $value) { |
|
| 130 | 130 | $notVirtual = false; |
| 131 | 131 | // not virtual only |
| 132 | 132 | if (!$page->isVirtual()) { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function sortByWeight($collection): array |
| 175 | 175 | { |
| 176 | - $callback = function ($a, $b) { |
|
| 176 | + $callback = function($a, $b) { |
|
| 177 | 177 | if (!isset($a['weight'])) { |
| 178 | 178 | return 1; |
| 179 | 179 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | */ |
| 207 | 207 | public function sortByDate($collection): array |
| 208 | 208 | { |
| 209 | - $callback = function ($a, $b) { |
|
| 209 | + $callback = function($a, $b) { |
|
| 210 | 210 | if (!isset($a['date'])) { |
| 211 | 211 | return -1; |
| 212 | 212 | } |
@@ -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 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | call_user_func_array($this->builder->getMessageCb(), ['GENERATE', 'Generating pages']); |
| 37 | 37 | |
| 38 | 38 | $generators = $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]); |