mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-09-25 20:01:56 +02:00
chore(psr4): phase 3 (Cli) — namespace Cli + switch console.php to FQCN discovery
Namespace all 55 Cli classes into XcVm\Cli (CommandInterface, CommandRegistry, CronTrait, DaemonTrait), XcVm\Cli\Commands (28) and XcVm\Cli\CronJobs (23); migration_logic.php stays procedural/global. - console.php: switch command discovery from basename==classname + manual require to FQCN resolution — each scan dir maps to its PSR-4 namespace, classes load via Composer, implementsInterface(CommandInterface::class). Drop the manual CommandInterface/CommandRegistry requires. This is the atomic switch the plan required to land with the Cli namespacing. - Commands/CronJobs get 'use XcVm\Cli\CommandInterface;' (implements) and the trait imports 'use XcVm\Cli\CronTrait;'/'DaemonTrait;'; rewrite the modules' 'use CommandRegistry;' → FQCN; qualify built-ins/global (\ReflectionClass, \PDO, \Exception, \RuntimeException, \XC_Autoloader, \XC_VM). - Fixtures: 'use CommandRegistry;' → FQCN; InterfaceContractTest registerCommands param-type → FQCN. phpstan-baseline.neon regenerated. Verified: php -l clean; PHPStan no errors; PHPUnit 295/295; FQCN discovery resolves 51 classes (49 implement CommandInterface); no mangled FQCNs; re-sweep clean.
This commit is contained in:
@@ -229,7 +229,7 @@ final class ModuleLoaderBootTest extends TestCase {
|
||||
. "use XcVm\Core\Module\ModuleInterface;\n"
|
||||
. "use XcVm\Core\Container\ServiceContainer;\n"
|
||||
. "use XcVm\\Core\\Http\\Router;\n"
|
||||
. "use CommandRegistry;\n"
|
||||
. "use XcVm\Cli\CommandRegistry;\n"
|
||||
. "use XcVm\Core\Module\NavbarRegistry;\n"
|
||||
. "class {$cls} implements ModuleInterface {\n"
|
||||
. "\tpublic function getName(): string { return '{$name}'; }\n"
|
||||
|
||||
Reference in New Issue
Block a user