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();
@@ 964-967 (lines=4) @@
961
     */
962
    protected function saveOrPublish($data, $form, $doPublish = false)
963
    {
964
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
965
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
966
                ->addHeader('Content-Type', 'application/json');
967
        }
968
969
        $id = (int) $data['ID'];
970
        /** @var File $record */
@@ 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 */