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:
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use MintyPHP\App\AppContainer;
|
||||
use MintyPHP\Http\RequestContext;
|
||||
|
||||
/**
|
||||
* Shared app bootstrap for non-module CLI commands.
|
||||
*/
|
||||
function cliBootstrapApp(string $channel = 'cli', string $path = 'bin/cli'): AppContainer
|
||||
{
|
||||
static $booted = false;
|
||||
/** @var AppContainer|null $container */
|
||||
static $container = null;
|
||||
|
||||
if (!$booted) {
|
||||
chdir(__DIR__ . '/..');
|
||||
require_once 'vendor/autoload.php';
|
||||
require_once 'config/config.php';
|
||||
require_once 'core/Support/helpers.php';
|
||||
|
||||
/** @var AppContainer $resolved */
|
||||
$resolved = require 'core/App/registerContainer.php';
|
||||
setAppContainer($resolved);
|
||||
|
||||
$container = $resolved;
|
||||
$booted = true;
|
||||
}
|
||||
|
||||
RequestContext::start([
|
||||
'channel' => $channel,
|
||||
'method' => 'CLI',
|
||||
'path' => $path,
|
||||
]);
|
||||
|
||||
if (!$container instanceof AppContainer) {
|
||||
throw new RuntimeException('CLI app container bootstrap failed.');
|
||||
}
|
||||
|
||||
return $container;
|
||||
}
|
||||
Reference in New Issue
Block a user