Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 281-284 (lines=4) @@
278
            return new HTTPResponse(null, 400);
279
        }
280
281
        if (!isset($vars['ids']) || !$vars['ids']) {
282
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
283
                ->addHeader('Content-Type', 'application/json');
284
        }
285
286
        $fileIds = $vars['ids'];
287
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 676-679 (lines=4) @@
673
     */
674
    protected function saveOrPublish($data, $form, $doPublish = false)
675
    {
676
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
677
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
678
                ->addHeader('Content-Type', 'application/json');
679
        }
680
681
        $id = (int) $data['ID'];
682
        /** @var File $record */
@@ 713-716 (lines=4) @@
710
711
    public function unpublish($data, $form)
712
    {
713
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
714
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
715
                ->addHeader('Content-Type', 'application/json');
716
        }
717
718
        $id = (int) $data['ID'];
719
        /** @var File $record */