Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 324-327 (lines=4) @@
321
            return new HTTPResponse(null, 400);
322
        }
323
324
        if (!isset($vars['ids']) || !$vars['ids']) {
325
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
326
                ->addHeader('Content-Type', 'application/json');
327
        }
328
329
        $fileIds = $vars['ids'];
330
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 936-939 (lines=4) @@
933
     */
934
    protected function saveOrPublish($data, $form, $doPublish = false)
935
    {
936
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
937
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
938
                ->addHeader('Content-Type', 'application/json');
939
        }
940
941
        $id = (int) $data['ID'];
942
        /** @var File $record */
@@ 969-972 (lines=4) @@
966
967
    public function unpublish($data, $form)
968
    {
969
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
970
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
971
                ->addHeader('Content-Type', 'application/json');
972
        }
973
974
        $id = (int) $data['ID'];
975
        /** @var File $record */