forked from fa/breadcrumb-the-shire
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks - Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists - Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services - Add Microsoft OIDC SSO, API token management, and user lifecycle features - Add swagger-ui vendor integration and OpenAPI spec - Add production Docker setup and bin/ scripts - Update composer dependencies, config, templates, and frontend assets throughout Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
90 lines
2.6 KiB
PHP
90 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\Support;
|
|
|
|
use MintyPHP\Support\Search\SearchItemMapperProvider;
|
|
use MintyPHP\Support\Search\SearchQueryNormalizer;
|
|
use MintyPHP\Support\Search\SearchSpecialResourceProvider;
|
|
use MintyPHP\Support\Search\SearchSqlResourceProvider;
|
|
use MintyPHP\Support\Search\SearchUiMetaProvider;
|
|
|
|
class SearchConfig
|
|
{
|
|
public static function tenantScopeFilters(): array
|
|
{
|
|
return SearchSqlResourceProvider::tenantScopeFilters();
|
|
}
|
|
|
|
public static function resources(string $query, string $locale): array
|
|
{
|
|
return SearchSqlResourceProvider::resources($query, $locale);
|
|
}
|
|
|
|
public static function iconForKey(string $key): string
|
|
{
|
|
return SearchUiMetaProvider::iconForKey($key);
|
|
}
|
|
|
|
public static function listUrl(string $key, string $query): string
|
|
{
|
|
return SearchUiMetaProvider::listUrl($key, $query);
|
|
}
|
|
|
|
public static function mapPreviewItem(string $key, array $data, string $query): ?array
|
|
{
|
|
return SearchItemMapperProvider::mapPreviewItem($key, $data, $query);
|
|
}
|
|
|
|
public static function mapResultItem(string $key, string $label, array $data): ?array
|
|
{
|
|
return SearchItemMapperProvider::mapResultItem($key, $label, $data);
|
|
}
|
|
|
|
public static function hotkeyPreviewResource(string $query): ?array
|
|
{
|
|
return SearchSpecialResourceProvider::hotkeyPreviewResource($query);
|
|
}
|
|
|
|
public static function hotkeyResultItems(string $query): array
|
|
{
|
|
return SearchSpecialResourceProvider::hotkeyResultItems($query);
|
|
}
|
|
|
|
public static function docsPreviewResource(string $query): ?array
|
|
{
|
|
return SearchSpecialResourceProvider::docsPreviewResource($query);
|
|
}
|
|
|
|
public static function docsResultItems(string $query): array
|
|
{
|
|
return SearchSpecialResourceProvider::docsResultItems($query);
|
|
}
|
|
|
|
public static function normalizeScoreQuery(string $query): string
|
|
{
|
|
return SearchQueryNormalizer::normalizeScoreQuery($query);
|
|
}
|
|
|
|
/**
|
|
* @return array{missingIcons: string[], missingListUrls: string[]}
|
|
*/
|
|
public static function providerCoverageGaps(): array
|
|
{
|
|
$missingIcons = [];
|
|
$missingListUrls = [];
|
|
foreach (SearchSqlResourceProvider::resourceKeys() as $key) {
|
|
if (!SearchUiMetaProvider::hasIconForKey($key)) {
|
|
$missingIcons[] = $key;
|
|
}
|
|
if (!SearchUiMetaProvider::hasListUrlForKey($key)) {
|
|
$missingListUrls[] = $key;
|
|
}
|
|
}
|
|
|
|
return [
|
|
'missingIcons' => $missingIcons,
|
|
'missingListUrls' => $missingListUrls,
|
|
];
|
|
}
|
|
}
|