Use an action when something should happen but the caller does not need a value back. Actions are synchronous and ordered: register callbacks with addAction(), then run them with doAction().
For example, an order-created action can notify an integration and write an audit entry without coupling the order class to either detail.
// Write an audit entry or notify a synchronous integration.
}, priority: 10);
hooks()->doAction('invoice.paid', 42, 'USD');
doAction() returns void. Callback return values are ignored, so use an action for side effects rather than for producing a value. You can pass any number of explicit arguments after the hook point.
Hooks takes a sorted snapshot before it starts. Adding or removing a listener inside a callback does not change the callbacks already selected for this run; the change is visible on the next run. Exceptions reach the caller.
The handle belongs to the Hooks instance that created it. If you prefer callback-based removal, removeAction($hookPoint, $callback, $priority) removes the first matching callback at that priority. Use removeAllActions(?string $hookPoint = null) to remove action registrations in bulk.
Actions do not transform values or collect results. Use filters for a sequential value or collectors for one result per listener.