Code Duplication    Length = 13-13 lines in 2 locations

src/Ui/ControlPanel/ControlPanelBuilder.php 1 location

@@ 153-165 (lines=13) @@
150
     * @param null   $position
151
     * @return $this
152
     */
153
    public function addNavigation($slug, array $navigation, $position = null)
154
    {
155
        if ($position === null) {
156
            $position = count($this->navigation) + 1;
157
        }
158
159
        $front = array_slice($this->navigation, 0, $position, true);
160
        $back  = array_slice($this->navigation, $position, count($this->navigation) - $position, true);
161
162
        $this->navigation = $front + [$slug => $navigation] + $back;
163
164
        return $this;
165
    }
166
167
    /**
168
     * Return the active control panel section.

src/Ui/Form/FormBuilder.php 1 location

@@ 694-706 (lines=13) @@
691
     * @param null   $position
692
     * @return $this
693
     */
694
    public function addSection($slug, array $section, $position = null)
695
    {
696
        if ($position === null) {
697
            $position = count($this->sections) + 1;
698
        }
699
700
        $front = array_slice($this->sections, 0, $position, true);
701
        $back  = array_slice($this->sections, $position, count($this->sections) - $position, true);
702
703
        $this->sections = $front + [$slug => $section] + $back;
704
705
        return $this;
706
    }
707
708
    /**
709
     * Add a section tab.