@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // filters pages: home, sections and terms |
| 32 | - $filteredPages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 32 | + $filteredPages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 33 | 33 | return in_array($page->getType(), [Type::HOMEPAGE, Type::SECTION, Type::TERM]); |
| 34 | 34 | }); |
| 35 | 35 | /** @var Page $page */ |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $paginationPath = $pagePagination['path']; |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | - $pages = $pages->filter(function (Page $page) { |
|
| 61 | + $pages = $pages->filter(function(Page $page) { |
|
| 62 | 62 | return $page->getVariable('published'); |
| 63 | 63 | }); |
| 64 | 64 | $pagesTotal = count($pages); |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | $this->url = new self($this->builder, $page, $options); |
| 116 | 116 | break; |
| 117 | 117 | // asset as string |
| 118 | - case false !== strpos($value, '.') ? true : false: |
|
| 119 | - $this->url = $base.'/'.ltrim($value, '/'); |
|
| 118 | + case false !== strpos($value, '.') ? true : false : $this->url = $base.'/'.ltrim($value, '/'); |
|
| 120 | 119 | break; |
| 121 | 120 | // others cases? |
| 122 | 121 | default: |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | /** @var \Cecil\Collection\Page\Page $page */ |
| 62 | 62 | if ($page->hasVariable('cascade')) { |
| 63 | 63 | $cascade = $page->getVariable('cascade'); |
| 64 | - $pages->map(function (Page $page) use ($cascade) { |
|
| 64 | + $pages->map(function(Page $page) use ($cascade) { |
|
| 65 | 65 | foreach ($cascade as $key => $value) { |
| 66 | 66 | if (!$page->hasVariable($key)) { |
| 67 | 67 | $page->setVariable($key, $value); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public static function joinPath(string ...$path): string |
| 46 | 46 | { |
| 47 | - $path = array_filter($path, function ($path) { |
|
| 47 | + $path = array_filter($path, function($path) { |
|
| 48 | 48 | return !empty($path) && !is_null($path); |
| 49 | 49 | }); |
| 50 | - array_walk($path, function (&$value, $key) { |
|
| 50 | + array_walk($path, function(&$value, $key) { |
|
| 51 | 51 | $value = str_replace('\\', '/', $value); |
| 52 | 52 | $value = rtrim($value, '/'); |
| 53 | 53 | $value = $key == 0 ? $value : ltrim($value, '/'); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public static function joinFile(string ...$path): string |
| 67 | 67 | { |
| 68 | - array_walk($path, function (&$value, $key) use (&$path) { |
|
| 68 | + array_walk($path, function(&$value, $key) use (&$path) { |
|
| 69 | 69 | $value = str_replace(['\\', '/'], [DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR], $value); |
| 70 | 70 | $value = rtrim($value, DIRECTORY_SEPARATOR); |
| 71 | 71 | $value = $key == 0 ? $value : ltrim($value, DIRECTORY_SEPARATOR); |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function showable(): self |
| 24 | 24 | { |
| 25 | - $filteredPages = $this->filter(function (Page $page) { |
|
| 25 | + $filteredPages = $this->filter(function(Page $page) { |
|
| 26 | 26 | if ($page->getVariable('published') === true |
| 27 | 27 | && $page->isVirtual() === false |
| 28 | 28 | && $page->getVariable('redirect') === null |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function sortByDate(): self |
| 51 | 51 | { |
| 52 | - return $this->usort(function ($a, $b) { |
|
| 52 | + return $this->usort(function($a, $b) { |
|
| 53 | 53 | if ($a['date'] == $b['date']) { |
| 54 | 54 | return 0; |
| 55 | 55 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function sortByTitle(): self |
| 67 | 67 | { |
| 68 | - return $this->usort(function ($a, $b) { |
|
| 68 | + return $this->usort(function($a, $b) { |
|
| 69 | 69 | return strnatcmp($a['title'], $b['title']); |
| 70 | 70 | }); |
| 71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public function sortByWeight(): self |
| 79 | 79 | { |
| 80 | - return $this->usort(function ($a, $b) { |
|
| 80 | + return $this->usort(function($a, $b) { |
|
| 81 | 81 | if ($a['weight'] == $b['weight']) { |
| 82 | 82 | return 0; |
| 83 | 83 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | public static function fileGetContents(string $filename, bool $userAgent = false) |
| 38 | 38 | { |
| 39 | 39 | set_error_handler( |
| 40 | - function ($severity, $message, $file, $line) { |
|
| 40 | + function($severity, $message, $file, $line) { |
|
| 41 | 41 | throw new \ErrorException($message, 0, $severity, $file, $line, null); |
| 42 | 42 | } |
| 43 | 43 | ); |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | { |
| 47 | 47 | $this->generate(); |
| 48 | 48 | |
| 49 | - $this->generatedPages->map(function (\Cecil\Collection\Page\Page $page) { |
|
| 49 | + $this->generatedPages->map(function(\Cecil\Collection\Page\Page $page) { |
|
| 50 | 50 | if (!$page->hasVariable('language')) { |
| 51 | 51 | $page->setVariable('language', $this->config->getLanguageDefault()); |
| 52 | 52 | } |
@@ -334,7 +334,7 @@ |
||
| 334 | 334 | |
| 335 | 335 | try { |
| 336 | 336 | $img = ImageManager::make($this->data['source']); |
| 337 | - $img->resize($size, null, function (\Intervention\Image\Constraint $constraint) { |
|
| 337 | + $img->resize($size, null, function(\Intervention\Image\Constraint $constraint) { |
|
| 338 | 338 | $constraint->aspectRatio(); |
| 339 | 339 | $constraint->upsize(); |
| 340 | 340 | }); |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | protected function collectTermsFromPages(): void |
| 94 | 94 | { |
| 95 | 95 | /** @var Page $page */ |
| 96 | - $pages = $this->builder->getPages()->filter(function (Page $page) { |
|
| 96 | + $pages = $this->builder->getPages()->filter(function(Page $page) { |
|
| 97 | 97 | return $page->getVariable('published'); |
| 98 | 98 | })->sortByDate(); |
| 99 | 99 | foreach ($pages as $page) { |