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();
@@ 877-880 (lines=4) @@
874
     */
875
    protected function saveOrPublish($data, $form, $doPublish = false)
876
    {
877
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
878
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
879
                ->addHeader('Content-Type', 'application/json');
880
        }
881
882
        $id = (int) $data['ID'];
883
        /** @var File $record */
@@ 915-918 (lines=4) @@
912
913
    public function unpublish($data, $form)
914
    {
915
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
916
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
917
                ->addHeader('Content-Type', 'application/json');
918
        }
919
920
        $id = (int) $data['ID'];
921
        /** @var File $record */