Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

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