| @@ 75-88 (lines=14) @@ | ||
| 72 | * |
|
| 73 | * @return $this |
|
| 74 | */ |
|
| 75 | public function registerFlow(FlowInterface $flow) |
|
| 76 | { |
|
| 77 | $flowId = $flow->getId(); |
|
| 78 | if (isset(static::$flows[$flowId])) { |
|
| 79 | throw new NodalFlowException('Duplicate Flow instances are not allowed', 1, null, [ |
|
| 80 | 'flowClass' => get_class($flow), |
|
| 81 | 'flowId' => $flowId, |
|
| 82 | ]); |
|
| 83 | } |
|
| 84 | ||
| 85 | static::$flows[$flowId] = $flow; |
|
| 86 | ||
| 87 | return $this; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * @param NodeInterface $node |
|
| @@ 97-110 (lines=14) @@ | ||
| 94 | * |
|
| 95 | * @return $this |
|
| 96 | */ |
|
| 97 | public function registerNode(NodeInterface $node) |
|
| 98 | { |
|
| 99 | $nodeId = $node->getId(); |
|
| 100 | if (isset(static::$nodes[$nodeId])) { |
|
| 101 | throw new NodalFlowException('Duplicate Node instances are not allowed', 1, null, [ |
|
| 102 | 'nodeClass' => get_class($node), |
|
| 103 | 'nodeId' => $nodeId, |
|
| 104 | ]); |
|
| 105 | } |
|
| 106 | ||
| 107 | static::$nodes[$nodeId] = $node; |
|
| 108 | ||
| 109 | return $this; |
|
| 110 | } |
|
| 111 | ||
| 112 | /** |
|
| 113 | * @param $flowId |
|