Commit Graph
3 Commits
Author SHA1 Message Date
Divarion-D dc335a8334 chore(psr4): phase 3 (Core) — namespace Core/Enum + Core/Exception
- Core/Enum → XcVm\Core\Enum (BootContext, ModuleState, ServerEnvironment).
- Core/Exception → XcVm\Core\Exception (XcVmException) + \Container
  (ContainerException, CircularDependencyException, ServiceCreationException) +
  \Module (ModuleException + the 4 module exceptions). The hierarchy resolves:
  XcVmException extends \RuntimeException; the Container/Module exceptions extend
  XcVmException via use; ContainerException keeps its PSR ContainerExceptionInterface.
- Add use to referrers across src/ and tests/; fix the leading-backslash refs
  qualified in earlier hub commits (\ModuleState, \ServerEnvironment,
  \XcVmException, \ContainerException, \ModuleLoadException, ...) to their FQCNs.
- phpstan-baseline.neon regenerated (292→292).

Verified: php -l clean; PHPStan no errors (first pass); PHPUnit 295/295;
leading-backslash re-sweep clean.
2026-06-24 22:23:42 +03:00
Divarion-D e8b7ab8b2e 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.
2026-06-24 22:13:35 +03:00
Divarion-D 0d8607b17b test: add comprehensive test suite covering all P2–P4 audit phases (242 tests)
New test files:
- ModuleLoaderBootTest — 11 tests: boot lifecycle, event subscribers, BaseModule compat
- ModuleManagerMigrationsTest — 8 tests: versioned migrations, semver ordering, install/uninstall state
- ModuleStateEnumTest — 12 tests: fromRaw(), isLoadable(), ModuleManager integration
- ComposerDiscoveryTest — 7 tests: Composer 1/2 format, xcvm-module filter, deduplication, module-path
- CronProviderTest — 8 tests: BaseModule default, collectCronEntries aggregation, format validation
- ExceptionHierarchyTest — hierarchy correctness, PSR-11 NotFoundException compliance
- InterfaceContractTest — 29 reflection tests verifying all documented interface signatures
- ListensToAttributeTest — 8 tests: attribute shape, ModuleLoader integration, IS_REPEATABLE, hybrid mode
- ArchitectureTest — enforces no global \$db in modules or domain, BaseModule contract

Updated ModuleLoaderTest and ModuleLoaderPriorityTest for namespaced class
generation and resolveClassName() removal.
2026-06-15 18:07:50 +03:00