Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 327-330 (lines=4) @@
324
            return new HTTPResponse(null, 400);
325
        }
326
327
        if (!isset($vars['ids']) || !$vars['ids']) {
328
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
329
                ->addHeader('Content-Type', 'application/json');
330
        }
331
332
        $fileIds = $vars['ids'];
333
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 1006-1009 (lines=4) @@
1003
     */
1004
    protected function saveOrPublish($data, $form, $doPublish = false)
1005
    {
1006
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1007
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1008
                ->addHeader('Content-Type', 'application/json');
1009
        }
1010
1011
        $id = (int) $data['ID'];
1012
        /** @var File $record */
@@ 1051-1054 (lines=4) @@
1048
1049
    public function unpublish($data, $form)
1050
    {
1051
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1052
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1053
                ->addHeader('Content-Type', 'application/json');
1054
        }
1055
1056
        $id = (int) $data['ID'];
1057
        /** @var File $record */