Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 306-309 (lines=4) @@
303
            return new HTTPResponse(null, 400);
304
        }
305
306
        if (!isset($vars['ids']) || !$vars['ids']) {
307
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
308
                ->addHeader('Content-Type', 'application/json');
309
        }
310
311
        $fileIds = $vars['ids'];
312
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 995-998 (lines=4) @@
992
993
    public function unpublish($data, $form)
994
    {
995
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
996
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
997
                ->addHeader('Content-Type', 'application/json');
998
        }
999
1000
        $id = (int) $data['ID'];
1001
        /** @var File $record */
@@ 962-965 (lines=4) @@
959
     */
960
    protected function saveOrPublish($data, $form, $doPublish = false)
961
    {
962
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
963
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
964
                ->addHeader('Content-Type', 'application/json');
965
        }
966
967
        $id = (int) $data['ID'];
968
        /** @var File $record */