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();
@@ 996-999 (lines=4) @@
993
     */
994
    protected function saveOrPublish($data, $form, $doPublish = false)
995
    {
996
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
997
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
998
                ->addHeader('Content-Type', 'application/json');
999
        }
1000
1001
        $id = (int) $data['ID'];
1002
        /** @var File $record */
@@ 1034-1037 (lines=4) @@
1031
1032
    public function unpublish($data, $form)
1033
    {
1034
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1035
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1036
                ->addHeader('Content-Type', 'application/json');
1037
        }
1038
1039
        $id = (int) $data['ID'];
1040
        /** @var File $record */