Code Duplication    Length = 8-10 lines in 2 locations

code/Forms/AssetFormFactory.php 2 locations

@@ 116-123 (lines=8) @@
113
     * @param File $record
114
     * @return FormAction
115
     */
116
    protected function getSaveAction($record)
117
    {
118
        if ($record && $record->isInDB() && $record->canEdit()) {
119
            return FormAction::create('save', _t('CMSMain.SAVE', 'Save'))
120
                ->setIcon('save');
121
        }
122
        return null;
123
    }
124
125
    /**
126
     * Get delete action, if this record is deletable
@@ 131-140 (lines=10) @@
128
     * @param File $record
129
     * @return FormAction
130
     */
131
    protected function getDeleteAction($record)
132
    {
133
        // Delete action
134
        if ($record && $record->isInDB() && $record->canDelete()) {
135
            $deleteText = _t('SilverStripe\\AssetAdmin\\Controller\\AssetAdmin.DELETE_BUTTON', 'Delete');
136
            return FormAction::create('delete', $deleteText)
137
                ->setIcon('trash-bin');
138
        }
139
        return null;
140
    }
141
142
    protected function getFormActions(Controller $controller, $name, $context = [])
143
    {