Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 341-344 (lines=4) @@
338
            return new HTTPResponse(null, 400);
339
        }
340
341
        if (!isset($vars['ids']) || !$vars['ids']) {
342
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
343
                ->addHeader('Content-Type', 'application/json');
344
        }
345
346
        $fileIds = $vars['ids'];
347
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 1000-1003 (lines=4) @@
997
     */
998
    protected function saveOrPublish($data, $form, $doPublish = false)
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 */
@@ 1033-1036 (lines=4) @@
1030
1031
    public function unpublish($data, $form)
1032
    {
1033
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1034
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1035
                ->addHeader('Content-Type', 'application/json');
1036
        }
1037
1038
        $id = (int) $data['ID'];
1039
        /** @var File $record */