getRouteParam('folderId'); if (!$folderId) { throw new BadRequest(); } $data = $request->getParsedBody(); $ids = $data->ids ?? null; $id = $data->id ?? null; if ($ids === null && is_string($id)) { $ids = [$id]; } if (!is_array($ids)) { throw new BadRequest("No `ids`."); } if (count($ids) === 1) { $this->inboxService->moveToFolder($ids[0], $folderId); } $this->inboxService->moveToFolderIdList($ids, $folderId); return ResponseComposer::json(true); } }