Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 350-353 (lines=4) @@
347
            return new HTTPResponse(null, 400);
348
        }
349
350
        if (!isset($vars['ids']) || !$vars['ids']) {
351
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
352
                ->addHeader('Content-Type', 'application/json');
353
        }
354
355
        $fileIds = $vars['ids'];
356
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 1022-1025 (lines=4) @@
1019
     */
1020
    protected function saveOrPublish($data, $form, $doPublish = false)
1021
    {
1022
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1023
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1024
                ->addHeader('Content-Type', 'application/json');
1025
        }
1026
1027
        $id = (int) $data['ID'];
1028
        /** @var File $record */
@@ 1055-1058 (lines=4) @@
1052
1053
    public function unpublish($data, $form)
1054
    {
1055
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
1056
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
1057
                ->addHeader('Content-Type', 'application/json');
1058
        }
1059
1060
        $id = (int) $data['ID'];
1061
        /** @var File $record */