Code Duplication    Length = 4-4 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 306-309 (lines=4) @@
303
            return new HTTPResponse(null, 400);
304
        }
305
306
        if (!isset($vars['ids']) || !$vars['ids']) {
307
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
308
                ->addHeader('Content-Type', 'application/json');
309
        }
310
311
        $fileIds = $vars['ids'];
312
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
@@ 927-930 (lines=4) @@
924
     */
925
    protected function saveOrPublish($data, $form, $doPublish = false)
926
    {
927
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
928
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
929
                ->addHeader('Content-Type', 'application/json');
930
        }
931
932
        $id = (int) $data['ID'];
933
        /** @var File $record */
@@ 965-968 (lines=4) @@
962
963
    public function unpublish($data, $form)
964
    {
965
        if (!isset($data['ID']) || !is_numeric($data['ID'])) {
966
            return (new HTTPResponse(json_encode(['status' => 'error']), 400))
967
                ->addHeader('Content-Type', 'application/json');
968
        }
969
970
        $id = (int) $data['ID'];
971
        /** @var File $record */