Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 285-288 (lines=4) @@
282
            return new HTTPResponse(null, 400);
283
        }
284
285
        if (!isset($vars['ids']) || !$vars['ids']) {
286
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
287
                ->addHeader('Content-Type', 'application/json');
288
        }
289
290
        $fileIds = $vars['ids'];
291
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 746-749 (lines=4) @@
743
     */
744
    protected function saveOrPublish($data, $form, $doPublish = false)
745
    {
746
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
747
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
748
                ->addHeader('Content-Type', 'application/json');
749
        }
750
751
        $id = (int) $data['ID'];
752
        /** @var File $record */
@@ 784-787 (lines=4) @@
781
782
    public function unpublish($data, $form)
783
    {
784
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
785
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
786
                ->addHeader('Content-Type', 'application/json');
787
        }
788
789
        $id = (int) $data['ID'];
790
        /** @var File $record */