Code Duplication    Length = 4-5 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 767-770 (lines=4) @@
764
765
        // Configure form to respond to validation errors with form schema
766
        // if requested via react.
767
        $form->setValidationResponseCallback(function() use ($form, $file) {
768
            $schemaId = Controller::join_links($this->Link('schema/FileEditForm'), $file->exists() ? $file->ID : '');
769
            return $this->getSchemaResponse($form, $schemaId);
770
        });
771
772
        return $form;
773
    }
@@ 872-876 (lines=5) @@
869
870
        // Configure form to respond to validation errors with form schema
871
        // if requested via react.
872
        $form->setValidationResponseCallback(function() use ($form, $file) {
873
            $schemaId = Controller::join_links($this->Link('schema/FileHistoryForm'), $file->exists() ? $file->ID : '');
874
875
            return $this->getSchemaResponse($form, $schemaId);
876
        });
877
878
        $form->makeReadonly();
879
@@ 1203-1206 (lines=4) @@
1200
        $handler = AddToCampaignHandler::create($this, $record);
1201
        $form = $handler->Form($record);
1202
1203
        $form->setValidationResponseCallback(function() use ($form, $id) {
1204
            $schemaId = Controller::join_links($this->Link('schema/AddToCampaignForm'), $id);
1205
            return $this->getSchemaResponse($form, $schemaId);
1206
        });
1207
1208
        return $form;
1209
    }