From abac409d44b9ed52e108dcc13bf1a486e679f3ee Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Wed, 13 Dec 2023 16:11:45 +0100 Subject: [PATCH] Add new internal GeneratesDocumentationSearchIndex::generate method --- .../Actions/GeneratesDocumentationSearchIndex.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php b/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php index 4fdcbc576df..85e17aa1448 100644 --- a/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php +++ b/packages/framework/src/Framework/Actions/GeneratesDocumentationSearchIndex.php @@ -39,6 +39,17 @@ public static function handle(): string return $service->path; } + /** + * Generate the search index return it as a string. + */ + public static function generate(): string + { + $service = new static(); + $service->run(); + + return $service->index->toJson(); + } + protected function __construct() { $this->index = new Collection();