Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 310-313 (lines=4) @@
307
            return new HTTPResponse(null, 400);
308
        }
309
310
        if (!isset($vars['ids']) || !$vars['ids']) {
311
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
312
                ->addHeader('Content-Type', 'application/json');
313
        }
314
315
        $fileIds = $vars['ids'];
316
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 975-978 (lines=4) @@
972
     */
973
    protected function saveOrPublish($data, $form, $doPublish = false)
974
    {
975
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
976
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
977
                ->addHeader('Content-Type', 'application/json');
978
        }
979
980
        $id = (int) $data['ID'];
981
        /** @var File $record */
@@ 1013-1016 (lines=4) @@
1010
1011
    public function unpublish($data, $form)
1012
    {
1013
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1014
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1015
                ->addHeader('Content-Type', 'application/json');
1016
        }
1017
1018
        $id = (int) $data['ID'];
1019
        /** @var File $record */