refactor: remove 13 dead code artifacts across core/
Dead methods (9): - Command::bootstrapModuleApp() — unused by all subclasses - SearchConfig::providerCoverageGaps() — diagnostic method, never called - RequestInput::queryArray() — no callers - LocaleResolver::getAvailableLocales() / getDefaultLocale() — unused getters - EmailVerificationService::getExpiryMinutes() — constant wrapper, never called - AuthService::loginAndRedirect() — convenience wrapper, never called - DepartmentService::listForUserAssignments() — no callers - UserTenantContextService::getAvailableDepartmentsByTenant() — no callers Dead functions (3): - navActivePublicPages(), appNormalizeStringList(), appNormalizePositiveIntList() Dead constant (1): - PermissionService::API_DOCS_VIEW — duplicated via other paths Orphaned file (1): - bin/cli-bootstrap.php — never included anywhere Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -241,25 +241,4 @@ class SearchConfig
|
||||
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,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,34 +354,6 @@ function layoutHasAdminPanel(array $layoutAuth): bool
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize list-like input to sorted unique non-empty strings.
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
function appNormalizeStringList(mixed $value): array
|
||||
{
|
||||
$raw = is_array($value) ? $value : explode(',', (string) $value);
|
||||
$list = array_filter(array_map('trim', $raw), static fn ($item) => $item !== '');
|
||||
$list = array_values(array_unique($list));
|
||||
sort($list, SORT_STRING);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize list-like input to sorted unique positive integers.
|
||||
*
|
||||
* @return list<int>
|
||||
*/
|
||||
function appNormalizePositiveIntList(mixed $value): array
|
||||
{
|
||||
$raw = is_array($value) ? $value : explode(',', (string) $value);
|
||||
$list = array_values(array_unique(array_map('intval', $raw)));
|
||||
$list = array_values(array_filter($list, static fn ($item) => $item > 0));
|
||||
sort($list, SORT_NUMERIC);
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reserved top-level keys in layout navigation context that modules must not override.
|
||||
*
|
||||
|
||||
@@ -416,30 +416,6 @@ function navActive($path, bool $prefix = false): array
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve active state for public page links (static pages and page/* slugs).
|
||||
*
|
||||
* @param array $extraSlugs Additional public slugs that should be treated as active.
|
||||
* @return array{class:string,aria:string,isActive:bool}
|
||||
*/
|
||||
function navActivePublicPages(array $extraSlugs = []): array
|
||||
{
|
||||
$current = \MintyPHP\Http\Request::path();
|
||||
if ($current === '') {
|
||||
return ['class' => '', 'aria' => '', 'isActive' => false];
|
||||
}
|
||||
|
||||
// "page/<slug>" routes and known standalone slugs should highlight the same nav entry.
|
||||
$publicSlugs = array_merge(['imprint', 'privacy', 'terms'], $extraSlugs);
|
||||
$isActive = strpos($current, 'page/') === 0 || in_array($current, $publicSlugs, true);
|
||||
|
||||
return [
|
||||
'class' => $isActive ? 'active' : '',
|
||||
'aria' => $isActive ? 'aria-current="page"' : '',
|
||||
'isActive' => $isActive,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and cache the asset registry config from config/assets.php.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user