Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| GenerateSearch | |
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| handle | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| printFinishMessage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Hyde\Framework\Actions\PostBuildTasks; |
| 6 | |
| 7 | use Hyde\Framework\Concerns\InteractsWithDirectories; |
| 8 | use Hyde\Framework\Features\BuildTasks\PostBuildTask; |
| 9 | use Hyde\Framework\Features\Documentation\DocumentationSearchPage; |
| 10 | use Hyde\Framework\Actions\GeneratesDocumentationSearchIndex; |
| 11 | |
| 12 | class GenerateSearch extends PostBuildTask |
| 13 | { |
| 14 | use InteractsWithDirectories; |
| 15 | |
| 16 | public static string $message = 'Generating search index'; |
| 17 | |
| 18 | protected string $path; |
| 19 | |
| 20 | public function handle(): void |
| 21 | { |
| 22 | $this->path = GeneratesDocumentationSearchIndex::handle(); |
| 23 | |
| 24 | if (DocumentationSearchPage::enabled()) { |
| 25 | $this->createdSiteFile(DocumentationSearchPage::generate()); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | public function printFinishMessage(): void |
| 30 | { |
| 31 | $this->createdSiteFile($this->path)->withExecutionTime(); |
| 32 | } |
| 33 | } |