@@ -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 | { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | $generatedPages = new PagesCollection(); |
| 25 | 25 | |
| 26 | - $filteredPages = $pagesCollection->filter(function (Page $page) { |
|
| 26 | + $filteredPages = $pagesCollection->filter(function(Page $page) { |
|
| 27 | 27 | return null !== $page->getVariable('title'); |
| 28 | 28 | }); |
| 29 | 29 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Sort items by date. |
| 20 | 20 | * |
| 21 | - * @return self |
|
| 21 | + * @return string|null |
|
| 22 | 22 | */ |
| 23 | 23 | public function sortByDate(): self |
| 24 | 24 | { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function sortByDate(): self |
| 24 | 24 | { |
| 25 | - return $this->usort(function ($a, $b) { |
|
| 25 | + return $this->usort(function($a, $b) { |
|
| 26 | 26 | if (!isset($a['date'])) { |
| 27 | 27 | return -1; |
| 28 | 28 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function sortByTitle(): self |
| 46 | 46 | { |
| 47 | - return $this->usort(function ($a, $b) { |
|
| 47 | + return $this->usort(function($a, $b) { |
|
| 48 | 48 | return strnatcmp($a['title'], $b['title']); |
| 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 | |
@@ -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 | // dedicated getter? |
| 131 | 131 | $method = 'get'.ucfirst($variable); |
| 132 | 132 | if (method_exists($page, $method) && $page->$method() == $value) { |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function sortByWeight($collection): array |
| 170 | 170 | { |
| 171 | - $callback = function ($a, $b) { |
|
| 171 | + $callback = function($a, $b) { |
|
| 172 | 172 | if (!isset($a['weight'])) { |
| 173 | 173 | return 1; |
| 174 | 174 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function sortByDate($collection): array |
| 203 | 203 | { |
| 204 | - $callback = function ($a, $b) { |
|
| 204 | + $callback = function($a, $b) { |
|
| 205 | 205 | if (!isset($a['date'])) { |
| 206 | 206 | return -1; |
| 207 | 207 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $generatedPages = new PagesCollection(); |
| 26 | 26 | |
| 27 | 27 | if (!$pagesCollection->has('index')) { |
| 28 | - $filteredPages = $pagesCollection->filter(function (Page $page) { |
|
| 28 | + $filteredPages = $pagesCollection->filter(function(Page $page) { |
|
| 29 | 29 | return $page->getType() === TYPE::PAGE; |
| 30 | 30 | }); |
| 31 | 31 | $pages = $filteredPages->sortByDate(); |