Code Duplication    Length = 4-4 lines in 2 locations

code/Controller/AssetAdmin.php 2 locations

@@ 277-280 (lines=4) @@
274
            return new HTTPResponse(null, 400);
275
        }
276
277
        if (!isset($vars['ids']) || !$vars['ids']) {
278
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
279
                ->addHeader('Content-Type', 'application/json');
280
        }
281
282
        $fileIds = $vars['ids'];
283
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 662-665 (lines=4) @@
659
     */
660
    public function save($data, $form)
661
    {
662
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
663
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
664
                ->addHeader('Content-Type', 'application/json');
665
        }
666
667
        $id = (int) $data['ID'];
668
        $record = $this->getList()->filter('ID', $id)->first();