Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
HydeCoreExtension
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getPageClasses
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Foundation;
6
7use Hyde\Pages\HtmlPage;
8use Hyde\Pages\BladePage;
9use Hyde\Pages\MarkdownPage;
10use Hyde\Pages\MarkdownPost;
11use Hyde\Pages\DocumentationPage;
12use Hyde\Foundation\Concerns\HydeExtension;
13use Hyde\Facades\Features;
14
15use function array_filter;
16use function array_keys;
17
18class 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}