There’s a set of raw operation runners that know how to run the default operations:
- The callback runner that is able to run callback operations.
- The chain runner that is able to chain operation runners that supports different operation types.
This is the runner that runs the Callback operations.
1 2 3 4
use Tolerance\Operation\Runner\CallbackOperationRunner; $runner = new CallbackOperationRunner(); $result = $runner->run($operation);
Constructed by other runners, usually the raw ones, it uses the first one that supports to run the operation.
1 2 3 4 5 6 7 8
use Tolerance\Operation\Runner\ChainOperationRunner; use Tolerance\Operation\Runner\CallbackOperationRunner; $runner = new ChainOperationRunner([ new CallbackOperationRunner(), ]); $result = $runner->run($operation);
addOperationRunner method allows you to add another runner on the fly.