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
+2 -1
View File
@@ -1,5 +1,6 @@
<?php
use XcVm\Core\Container\ServiceContainer;
use XcVm\Core\Module\Contract\StreamMiddlewareProviderInterface;
use XcVm\Core\Module\Contract\ServiceProviderInterface;
use XcVm\Core\Module\Contract\RouteProviderInterface;
@@ -67,7 +68,7 @@ final class InterfaceContractTest extends TestCase {
public function testServiceProviderInterfaceHasBoot(): void {
$rc = new ReflectionClass(ServiceProviderInterface::class);
$this->assertInterfaceMethod($rc, 'boot', ['ServiceContainer'], 'void');
$this->assertInterfaceMethod($rc, 'boot', ['XcVm\Core\Container\ServiceContainer'], 'void');
}
public function testServiceProviderInterfaceHasGetEventSubscribers(): void {