refactor(core): remove unused BoundaryInterface marker

BoundaryInterface was a marker interface with no runtime consumer —
nothing read getEntryPoint()/isIsolated() and, being static-less
metadata, it enforced nothing. Its only implementor was MinistraModule.

Removes the interface, drops `implements BoundaryInterface` plus the two
orphaned methods from MinistraModule (getName/getVersion stay — they come
from BaseModule/ModuleInterface), and deletes the now-empty Core/Boundary/.

Test contract (InterfaceContractTest) loses the three BoundaryInterface
assertions; docs (en/ru architecture + modules, .github instructions) now
describe isolated subsystems like Ministra as a convention — own entry
point + bootstrap — rather than a marker interface.

Verified: php -l, make gates, make phpstan (No errors);
InterfaceContractTest + ArchitectureTest green (33 tests, 96 assertions).
This commit is contained in:
Divarion_D
2026-08-11 19:22:09 +03:00
parent 11d3a83d99
commit 9c7231c6ca
9 changed files with 23 additions and 127 deletions
-43
View File
@@ -2,7 +2,6 @@
use XcVm\Module\Ministra\MinistraModule;
use XcVm\Cli\CommandRegistry;
use XcVm\Core\Boundary\BoundaryInterface;
use XcVm\Core\Enum\ModuleState;
use XcVm\Core\Events\ListensTo;
use XcVm\Core\Events\EventDispatcher;
@@ -110,30 +109,6 @@ final class InterfaceContractTest extends TestCase {
$this->assertInterfaceMethod($rc, 'getStreamMiddleware', [], 'array');
}
// ── BoundaryInterface ─────────────────────────────────────────
public function testBoundaryInterfaceHasCorrectMethods(): void {
$rc = new ReflectionClass(BoundaryInterface::class);
$this->assertTrue($rc->isInterface());
$this->assertInterfaceMethod($rc, 'getName', [], 'string');
$this->assertInterfaceMethod($rc, 'getEntryPoint', [], 'string');
$this->assertInterfaceMethod($rc, 'isIsolated', [], 'bool');
}
public function testBoundaryInterfaceHasExactlyThreeMethods(): void {
$rc = new ReflectionClass(BoundaryInterface::class);
$own = array_filter(
$rc->getMethods(ReflectionMethod::IS_PUBLIC),
fn(ReflectionMethod $m) => $m->getDeclaringClass()->getName() === BoundaryInterface::class
);
$this->assertCount(
3,
$own,
'BoundaryInterface must have exactly 3 methods: getName, getEntryPoint, isIsolated'
);
}
// ── MigratableInterface ───────────────────────────────────────
public function testMigratableInterfaceHasGetMigrations(): void {
@@ -260,24 +235,6 @@ final class InterfaceContractTest extends TestCase {
}
}
// ── MinistraModule ────────────────────────────────────────────
public function testMinistraModuleImplementsBoundaryInterface(): void {
if (!class_exists(\XcVm\Module\Ministra\MinistraModule::class)) {
// Module directories use the `{name}_{hash5}` convention, so glob for the
// ministra dir rather than assuming a bare `Modules/ministra/` path.
$base = defined('MAIN_HOME') ? MAIN_HOME . 'Modules' : __DIR__ . '/../../src/Modules';
$matches = glob($base . '/ministra*/MinistraModule.php');
$file = $matches[0] ?? ($base . '/ministra/MinistraModule.php');
require_once $file;
}
$rc = new ReflectionClass(\XcVm\Module\Ministra\MinistraModule::class);
$this->assertTrue(
$rc->implementsInterface(BoundaryInterface::class),
'MinistraModule must implement BoundaryInterface'
);
}
// ── ModuleState enum ──────────────────────────────────────────
public function testModuleStateEnumExists(): void {