Code Duplication    Length = 8-10 lines in 2 locations

code/Forms/AssetFormFactory.php 2 locations

@@ 101-108 (lines=8) @@
98
     * @param File $record
99
     * @return FormAction
100
     */
101
    protected function getSaveAction($record)
102
    {
103
        if ($record && $record->isInDB() && $record->canEdit()) {
104
            return FormAction::create('save', _t('CMSMain.SAVE', 'Save'))
105
                ->setIcon('save');
106
        }
107
        return null;
108
    }
109
110
    /**
111
     * Get delete action, if this record is deletable
@@ 116-125 (lines=10) @@
113
     * @param File $record
114
     * @return FormAction
115
     */
116
    protected function getDeleteAction($record)
117
    {
118
        // Delete action
119
        if ($record && $record->isInDB() && $record->canDelete()) {
120
            $deleteText = _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.DELETE_BUTTON', 'Delete');
121
            return FormAction::create('delete', $deleteText)
122
                ->setIcon('trash-bin');
123
        }
124
        return null;
125
    }
126
127
    protected function getFormActions(Controller $controller, $name, $context = [])
128
    {