Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
HydeCoreExtension | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
getPageClasses | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Hyde\Foundation; |
6 | |
7 | use Hyde\Pages\HtmlPage; |
8 | use Hyde\Pages\BladePage; |
9 | use Hyde\Pages\MarkdownPage; |
10 | use Hyde\Pages\MarkdownPost; |
11 | use Hyde\Pages\DocumentationPage; |
12 | use Hyde\Foundation\Concerns\HydeExtension; |
13 | use Hyde\Facades\Features; |
14 | |
15 | use function array_filter; |
16 | use function array_keys; |
17 | |
18 | class HydeCoreExtension extends HydeExtension |
19 | { |
20 | /** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */ |
21 | public static function getPageClasses(): array |
22 | { |
23 | return array_keys(array_filter([ |
24 | HtmlPage::class => Features::hasHtmlPages(), |
25 | BladePage::class => Features::hasBladePages(), |
26 | MarkdownPage::class => Features::hasMarkdownPages(), |
27 | MarkdownPost::class => Features::hasMarkdownPosts(), |
28 | DocumentationPage::class => Features::hasDocumentationPages(), |
29 | ], fn (bool $value): bool => $value)); |
30 | } |
31 | } |