Code Duplication    Length = 5-8 lines in 2 locations

src/allejo/stakx/Manager/MenuManager.php 2 locations

@@ 89-93 (lines=5) @@
86
87
            if (!is_null($name) && count($dirs) == 0)
88
            {
89
                if (isset($root[$name]) && is_array($root[$name]))
90
                {
91
                    $children = &$pageView->getChildren();
92
                    $children = $root[$name]['children'];
93
                }
94
95
                $root[$name] = &$pageView;
96
            }
@@ 104-111 (lines=8) @@
101
                    $root[$name]['children'] = array();
102
                    $root = &$root[$name]['children'];
103
                }
104
                else if (isset($root[$name]) && is_array($root[$name]))
105
                {
106
                    $root = &$root[$name]['children'];
107
                }
108
                else
109
                {
110
                    $root = &$root[$name]->getChildren();
111
                }
112
            }
113
        }
114
    }