Code Duplication    Length = 4-4 lines in 2 locations

code/Controller/AssetAdmin.php 2 locations

@@ 351-354 (lines=4) @@
348
        $fileIds = $vars['ids'];
349
        $files = $this->getList()->filter("ID", $fileIds)->toArray();
350
351
        if (!count($files)) {
352
            return (new HTTPResponse(json_encode(['status' => 'error']), 404))
353
                ->addHeader('Content-Type', 'application/json');
354
        }
355
356
        if (!min(array_map(function (File $file) {
357
            return $file->canArchive();
@@ 1024-1027 (lines=4) @@
1021
        /** @var File $record */
1022
        $record = $this->getList()->filter('ID', $id)->first();
1023
1024
        if (!$record) {
1025
            return (new HTTPResponse(json_encode(['status' => 'error']), 404))
1026
                ->addHeader('Content-Type', 'application/json');
1027
        }
1028
1029
        if (!$record->canEdit() || ($doPublish && !$record->canPublish())) {
1030
            return (new HTTPResponse(json_encode(['status' => 'error']), 401))