chore(psr4): phase 3 (Core) — namespace Core/Container

Move Core/Container into XcVm\Core\Container (ServiceContainer) and
Core/Container/Psr into XcVm\Core\Container\Psr (ContainerInterface,
ContainerExceptionInterface, NotFoundExceptionInterface, NotFoundException).

- Namespace ServiceContainer + the 4 PSR-11 interfaces/classes.
- ServiceContainer: import the PSR siblings (use ...\Psr\ContainerInterface,
  NotFoundException); migrated deps (DatabaseHandler/ModuleInterface/Request/
  SettingsManager) keep their use; still-global exceptions/decorators qualified
  with leading backslash (\ContainerException, \XcVmException, \Exception, ...).
- Rewrite 'use ServiceContainer;' → FQCN (incl. module fixtures); add use to
  referrers across src/ and tests/; fix leading-backslash \ServiceContainer refs.
- Core/Exception/Container/ContainerException: import the moved PSR
  ContainerExceptionInterface.
- Router: class_exists('ServiceContainer') → ::class. InterfaceContractTest boot
  param-type → FQCN. Repaired use-inserter mis-placement in the two namespace()
  fixture tests.
- phpstan-baseline.neon regenerated (292→292).

Verified: php -l clean; PHPStan no errors; PHPUnit 295/295; ServiceContainer
resolves and implements XcVm\Core\Container\Psr\ContainerInterface.
This commit is contained in:
Divarion-D
2026-06-24 22:13:35 +03:00
parent 881991e52b
commit e8b7ab8b2e
37 changed files with 93 additions and 46 deletions
+3 -2
View File
@@ -4,6 +4,7 @@ use XcVm\Core\Http\Router;
use XcVm\Core\Module\ModuleLoader;
use XcVm\Core\Module\NavbarRegistry;
use XcVm\Core\Module\ModuleInterface;
use XcVm\Core\Container\ServiceContainer;
use PHPUnit\Framework\TestCase;
// Shared tracker — loaded by PHPUnit before any module PHP file is require_once'd by ModuleLoader.
@@ -225,7 +226,7 @@ final class ModuleLoaderBootTest extends TestCase {
$code = "<?php\n"
. "namespace {$ns};\n"
. "use XcVm\Core\Module\ModuleInterface;\n"
. "use ServiceContainer;\n"
. "use XcVm\Core\Container\ServiceContainer;\n"
. "use XcVm\\Core\\Http\\Router;\n"
. "use CommandRegistry;\n"
. "use XcVm\Core\Module\NavbarRegistry;\n"
@@ -255,7 +256,7 @@ final class ModuleLoaderBootTest extends TestCase {
$code = "<?php\n"
. "namespace {$ns};\n"
. "use XcVm\Core\Module\BaseModule;\n"
. "use ServiceContainer;\n"
. "use XcVm\Core\Container\ServiceContainer;\n"
. "class {$cls} extends BaseModule {\n"
. "\tpublic function getName(): string { return '{$name}'; }\n"
. "\tpublic function getVersion(): string { return '1.0.0'; }\n"