Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 307-310 (lines=4) @@
304
            return new HTTPResponse(null, 400);
305
        }
306
307
        if (!isset($vars['ids']) || !$vars['ids']) {
308
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
309
                ->addHeader('Content-Type', 'application/json');
310
        }
311
312
        $fileIds = $vars['ids'];
313
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 979-982 (lines=4) @@
976
     */
977
    protected function saveOrPublish($data, $form, $doPublish = false)
978
    {
979
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
980
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
981
                ->addHeader('Content-Type', 'application/json');
982
        }
983
984
        $id = (int) $data['ID'];
985
        /** @var File $record */
@@ 1012-1015 (lines=4) @@
1009
1010
    public function unpublish($data, $form)
1011
    {
1012
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1013
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1014
                ->addHeader('Content-Type', 'application/json');
1015
        }
1016
1017
        $id = (int) $data['ID'];
1018
        /** @var File $record */