Code Duplication    Length = 23-23 lines in 2 locations

src/Fwlib/Workflow/AbstractManager.php 2 locations

@@ 195-217 (lines=23) @@
192
    /**
193
     * {@inheritdoc}
194
     */
195
    public function disableActions(array $actions)
196
    {
197
        foreach ($this->nodes as $nodeIndex => &$node) {
198
            // Some node like end has no actions
199
            if (!array_key_exists('actions', $node)) {
200
                continue;
201
            }
202
203
            foreach ($node['actions'] as $action => $value) {
204
                if (in_array($action, $actions)) {
205
                    $this->disabledActions[$action] = [
206
                        'node'   => $nodeIndex,
207
                        'action' => $node['actions'][$action],
208
                    ];
209
210
                    unset($node['actions'][$action]);
211
                }
212
            }
213
        }
214
        unset($node);
215
216
        return $this;
217
    }
218
219
220
    /**
@@ 554-576 (lines=23) @@
551
    /**
552
     * {@inheritdoc}
553
     */
554
    public function limitActions(array $actions)
555
    {
556
        foreach ($this->nodes as $nodeIndex => &$node) {
557
            // Some node like end has no actions
558
            if (!array_key_exists('actions', $node)) {
559
                continue;
560
            }
561
562
            foreach ($node['actions'] as $action => $value) {
563
                if (!in_array($action, $actions)) {
564
                    $this->disabledActions[$action] = [
565
                        'node'   => $nodeIndex,
566
                        'action' => $node['actions'][$action],
567
                    ];
568
569
                    unset($node['actions'][$action]);
570
                }
571
            }
572
        }
573
        unset($node);
574
575
        return $this;
576
    }
577
578
579
    /**