Contracts
ModuleInterface
v1.0.0Core contract every module must implement. Defines the boot lifecycle and module identity.
Methods
public function boot(): voidCalled by the Hub after dependency injection. Register hooks, filters, and admin pages here.
public function slug(): stringReturns the unique module slug matching module.json.
public function version(): stringReturns 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';
}
}