MCPcopy Create free account
hub / github.com/EqualifyEverything/equalify / run_hook

Method run_hook

models/hooks.php:37–49  ·  view source on GitHub ↗
(string $hook)

Source from the content-addressed store, hash-verified

35 }
36
37 public function run_hook(string $hook): void {
38 // filter by hook
39 $filter = fn(Action $action) => $action->hook === $hook;
40 // order by priority
41 $sort = fn($a, $b) => $a->priority <=> $b->priority;
42 $actions_to_run = array_filter($this->_actions, $filter);
43 usort($actions_to_run, $sort);
44
45 foreach ($actions_to_run as $action) {
46 ($action->action)();
47 }
48
49 }
50
51}
52

Callers 1

index.phpFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected