Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 351-354 (lines=4) @@
348
            return new HTTPResponse(null, 400);
349
        }
350
351
        if (!isset($vars['ids']) || !$vars['ids']) {
352
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
353
                ->addHeader('Content-Type', 'application/json');
354
        }
355
356
        $fileIds = $vars['ids'];
357
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 1090-1093 (lines=4) @@
1087
     */
1088
    protected function saveOrPublish($data, $form, $doPublish = false)
1089
    {
1090
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1091
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1092
                ->addHeader('Content-Type', 'application/json');
1093
        }
1094
1095
        $id = (int) $data['ID'];
1096
        /** @var File $record */
@@ 1135-1138 (lines=4) @@
1132
1133
    public function unpublish($data, $form)
1134
    {
1135
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1136
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1137
                ->addHeader('Content-Type', 'application/json');
1138
        }
1139
1140
        $id = (int) $data['ID'];
1141
        /** @var File $record */