Code Duplication    Length = 9-9 lines in 2 locations

src/MenuBuilder.php 1 location

@@ 428-436 (lines=9) @@
425
     */
426
    public function url($url, $title, $order = 0, $attributes = array())
427
    {
428
        if (func_num_args() == 3) {
429
            $arguments = func_get_args();
430
431
            return $this->add([
432
                'url' => $this->formatUrl(Arr::get($arguments, 0)),
433
                'title' => Arr::get($arguments, 1),
434
                'attributes' => Arr::get($arguments, 2),
435
            ]);
436
        }
437
438
        $url = $this->formatUrl($url);
439

src/MenuItem.php 1 location

@@ 218-226 (lines=9) @@
215
     */
216
    public function url($url, $title, $order = 0, $attributes = array())
217
    {
218
        if (func_num_args() === 3) {
219
            $arguments = func_get_args();
220
221
            return $this->add([
222
                'url' => Arr::get($arguments, 0),
223
                'title' => Arr::get($arguments, 1),
224
                'attributes' => Arr::get($arguments, 2),
225
            ]);
226
        }
227
228
        return $this->add(compact('url', 'title', 'order', 'attributes'));
229
    }