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();
@@ 962-965 (lines=4) @@
959
     */
960
    protected function saveOrPublish($data, $form, $doPublish = false)
961
    {
962
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
963
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
964
                ->addHeader('Content-Type', 'application/json');
965
        }
966
967
        $id = (int) $data['ID'];
968
        /** @var File $record */
@@ 1000-1003 (lines=4) @@
997
998
    public function unpublish($data, $form)
999
    {
1000
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1001
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1002
                ->addHeader('Content-Type', 'application/json');
1003
        }
1004
1005
        $id = (int) $data['ID'];
1006
        /** @var File $record */