Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

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