Contracts and Interfaces

The Importance of Interfaces (SOLID)

In the Domain-System, we strictly apply the "Letter I" of SOLID (Interface Segregation Principle). Classes don't depend on each other, they depend on Contracts (Interfaces).

If the system expects you to extract ZIP files, it doesn't depend on the native ZIP library, it asks for an ExtractorInterface. This means tomorrow you can change the extraction method without breaking the entire system.

PluginInterface

Every plugin MUST sign this contract indirectly (by extending the abstract class AbstractPlugin). It dictates the lifecycle rules:

interface PluginInterface
{
    public function register(): void;
    public function boot(): void;
    public function activate(): void;
    public function deactivate(): void;
    public function uninstall(): void;
}

Explanation of Methods:

ManualModuleInterface (Manual Auto-Discovery v2.7.0)

Any plugin providing a manual/module.php file returning an instance of ManualModuleInterface is automatically discovered by PluginManualScanner and rendered inside the Cockpit's Instruction Manual (/admin/manual):

interface ManualModuleInterface
{
    public function getId(): string;
    public function getTitle(): string;
    public function getSubtitle(): string;
    public function getBadge(): string;
    public function getAccentColor(): string;
    public function getAdminUrl(): ?string;
    public function getChecklistItems(): array;
    public function renderContent(string $baseUrl = ''): string;
}

This enables plugins (such as Academy LMS, FlexTheme, Pages, and SEO) to ship their own interactive documentation and QA homologation checklists with zero coupling to the Kernel source code!

SchemaDoctorInterface & JsonStoreInterface (Database- and Environment-Agnostic Core)

In Domain-System v2.7.0, the core runtime operates in a database- and platform-agnostic manner:

🤖 AI Contract Guide

Refer to the Master AI Contract Guide (along with .github/copilot-instructions.md, .cursorrules, and .clinerules) to guide AI assistants in creating extensions compliant with these contracts.