Contracts

ModuleInterface

v1.0.0

Core contract every module must implement. Defines the boot lifecycle and module identity.

Methods

public function boot(): void

Called by the Hub after dependency injection. Register hooks, filters, and admin pages here.

public function slug(): string

Returns the unique module slug matching module.json.

public function version(): string

Returns the current module version string.

Example

module-interface.php
<?php

declare(strict_types=1);

use Meteorack\SDK\Contracts\ModuleInterface;

class My_Module implements ModuleInterface {

    public function boot(): void {
        add_action('admin_init', [$this, 'init']);
    }

    public function slug(): string {
        return 'my-module';
    }

    public function version(): string {
        return '1.0.0';
    }
}