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