Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 305-308 (lines=4) @@
302
            return new HTTPResponse(null, 400);
303
        }
304
305
        if (!isset($vars['ids']) || !$vars['ids']) {
306
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
307
                ->addHeader('Content-Type', 'application/json');
308
        }
309
310
        $fileIds = $vars['ids'];
311
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 960-963 (lines=4) @@
957
     */
958
    protected function saveOrPublish($data, $form, $doPublish = false)
959
    {
960
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
961
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
962
                ->addHeader('Content-Type', 'application/json');
963
        }
964
965
        $id = (int) $data['ID'];
966
        /** @var File $record */
@@ 998-1001 (lines=4) @@
995
996
    public function unpublish($data, $form)
997
    {
998
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
999
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1000
                ->addHeader('Content-Type', 'application/json');
1001
        }
1002
1003
        $id = (int) $data['ID'];
1004
        /** @var File $record */