2 namespace Consolidation\AnnotatedCommand\Hooks;
4 use Consolidation\AnnotatedCommand\CommandData;
7 * A result processor takes a result object, processes it, and
8 * returns another result object. For example, if a result object
9 * represents a 'task', then a task-runner hook could run the
10 * task and return the result from that execution.
12 * @see HookManager::addResultProcessor()
14 interface ProcessResultInterface
17 * After a command has executed, if the result is something
18 * that needs to be processed, e.g. a collection of tasks to
19 * run, then execute it and return the new result.
21 * @param mixed $result Result to (potentially) be processed
22 * @param CommandData $commandData Reference to commandline arguments and options
24 * @return mixed $result
26 public function process($result, CommandData $commandData);