Code Duplication    Length = 14-14 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 612-625 (lines=14) @@
609
     * @param HTTPRequest $request
610
     * @return Form
611
     */
612
    public function fileEditForm($request = null)
613
    {
614
        // Get ID either from posted back value, or url parameter
615
        if (!$request) {
616
            $this->httpError(400);
617
            return null;
618
        }
619
        $id = $request->param('ID');
620
        if (!$id) {
621
            $this->httpError(400);
622
            return null;
623
        }
624
        return $this->getFileEditForm($id);
625
    }
626
627
    /**
628
     * The form is used to generate a form schema,
@@ 647-660 (lines=14) @@
644
     * @param HTTPRequest $request
645
     * @return Form
646
     */
647
    public function fileInsertForm($request = null)
648
    {
649
        // Get ID either from posted back value, or url parameter
650
        if (!$request) {
651
            $this->httpError(400);
652
            return null;
653
        }
654
        $id = $request->param('ID');
655
        if (!$id) {
656
            $this->httpError(400);
657
            return null;
658
        }
659
        return $this->getFileInsertForm($id);
660
    }
661
    
662
    /**
663
     * The form used to generate a form schema, since it's used directly on API endpoints,
@@ 680-693 (lines=14) @@
677
     * @param HTTPRequest $request
678
     * @return Form
679
     */
680
    public function fileEditorLinkForm($request = null)
681
    {
682
        // Get ID either from posted back value, or url parameter
683
        if (!$request) {
684
            $this->httpError(400);
685
            return null;
686
        }
687
        $id = $request->param('ID');
688
        if (!$id) {
689
            $this->httpError(400);
690
            return null;
691
        }
692
        return $this->getFileInsertForm($id);
693
    }
694
    
695
    /**
696
     * Abstract method for generating a form for a file