Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 302-305 (lines=4) @@
299
            return new HTTPResponse(null, 400);
300
        }
301
302
        if (!isset($vars['ids']) || !$vars['ids']) {
303
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
304
                ->addHeader('Content-Type', 'application/json');
305
        }
306
307
        $fileIds = $vars['ids'];
308
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 878-881 (lines=4) @@
875
     */
876
    protected function saveOrPublish($data, $form, $doPublish = false)
877
    {
878
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
879
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
880
                ->addHeader('Content-Type', 'application/json');
881
        }
882
883
        $id = (int) $data['ID'];
884
        /** @var File $record */
@@ 916-919 (lines=4) @@
913
914
    public function unpublish($data, $form)
915
    {
916
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
917
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
918
                ->addHeader('Content-Type', 'application/json');
919
        }
920
921
        $id = (int) $data['ID'];
922
        /** @var File $record */