The HookService provides an event dispatching system for plugins.
use MarkdownMaster\Services\HookService;
// Register a hook
HookService::Register('file_saved', 'Called when a file is saved');
// Add a callback to the hook
HookService::Add('file_saved', function($file) {
// Plugin logic here
});
// Run the hook
HookService::Run('file_saved', $file);
You can get debug information about registered hooks:
$debug = HookService::GetDebugInfo();
print_r($debug);