| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class CallableInterruptNode extends InterruptNodeAbstract |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var callable |
||
| 22 | */ |
||
| 23 | protected $interrupter; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Instantiate a CallableInterruptNode Node |
||
| 27 | * |
||
| 28 | * @param callable $interrupter |
||
| 29 | * |
||
| 30 | * @throws NodalFlowException |
||
| 31 | */ |
||
| 32 | public function __construct(callable $interrupter) |
||
| 33 | { |
||
| 34 | $this->interrupter = $interrupter; |
||
| 35 | parent::__construct(); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param mixed $param |
||
| 40 | * |
||
| 41 | * @return InterrupterInterface|null|bool `null` do do nothing, eg let the Flow proceed untouched |
||
| 42 | * `true` to trigger a continue on the carrier Flow (not ancestors) |
||
| 43 | * `false` to trigger a break on the carrier Flow (not ancestors) |
||
| 44 | * `InterrupterInterface` to trigger an interrupt to propagate up to a target (which may be one ancestor) |
||
| 45 | */ |
||
| 46 | public function interrupt($param) |
||
| 49 | } |
||
| 50 | } |
||
| 51 |