From bdc992003a7a0c0bd4313be2bd9ed8889238c164 Mon Sep 17 00:00:00 2001 From: grnd-alt Date: Mon, 18 Mar 2024 16:40:26 +0100 Subject: [PATCH] fix php linting issues Signed-off-by: grnd-alt --- lib/Command/RenameTable.php | 3 ++- lib/Controller/Api1Controller.php | 2 +- lib/Controller/ApiTablesController.php | 4 ++-- lib/Controller/TableController.php | 2 +- lib/Db/Table.php | 2 +- lib/Service/TableService.php | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/Command/RenameTable.php b/lib/Command/RenameTable.php index 3a41153b5..098cace43 100644 --- a/lib/Command/RenameTable.php +++ b/lib/Command/RenameTable.php @@ -82,9 +82,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $title = $input->getArgument('title'); $emoji = $input->getOption('emoji'); $archived = $input->getOption('archived'); + $description = $input->getOption('description'); try { - $table = $this->tableService->update($id, $title, $emoji, $archived, ''); + $table = $this->tableService->update($id, $title, $emoji, null, $archived, ''); $arr = $table->jsonSerialize(); unset($arr['hasShares']); diff --git a/lib/Controller/Api1Controller.php b/lib/Controller/Api1Controller.php index f9614349b..438cad369 100644 --- a/lib/Controller/Api1Controller.php +++ b/lib/Controller/Api1Controller.php @@ -181,7 +181,7 @@ public function getTable(int $tableId): DataResponse { */ public function updateTable(int $tableId, string $title = null, string $emoji = null, ?bool $archived = false): DataResponse { try { - return new DataResponse($this->tableService->update($tableId, $title, $emoji, $archived, $this->userId)->jsonSerialize()); + return new DataResponse($this->tableService->update($tableId, $title, $emoji, null, $archived, $this->userId)->jsonSerialize()); } catch (PermissionError $e) { $this->logger->warning('A permission error occurred: ' . $e->getMessage()); $message = ['message' => $e->getMessage()]; diff --git a/lib/Controller/ApiTablesController.php b/lib/Controller/ApiTablesController.php index 5e0d056bf..11cf56962 100644 --- a/lib/Controller/ApiTablesController.php +++ b/lib/Controller/ApiTablesController.php @@ -108,9 +108,9 @@ public function create(string $title, ?string $emoji, string $template = 'custom * 403: No permissions * 404: Not found */ - public function update(int $id, ?string $title = null, ?string $emoji = null,?string $description = null,?bool $archived = null): DataResponse { + public function update(int $id, ?string $title = null, ?string $emoji = null, ?string $description = null, ?bool $archived = null): DataResponse { try { - return new DataResponse($this->service->update($id, $title, $emoji, $description,$archived, $this->userId)->jsonSerialize()); + return new DataResponse($this->service->update($id, $title, $emoji, $description, $archived, $this->userId)->jsonSerialize()); } catch (PermissionError $e) { return $this->handlePermissionError($e); } catch (InternalError $e) { diff --git a/lib/Controller/TableController.php b/lib/Controller/TableController.php index 65d4e7fd0..0c2e2fa23 100644 --- a/lib/Controller/TableController.php +++ b/lib/Controller/TableController.php @@ -72,7 +72,7 @@ public function destroy(int $id): DataResponse { */ public function update(int $id, string $title = null, string $emoji = null, ?bool $archived = null): DataResponse { return $this->handleError(function () use ($id, $title, $emoji, $archived) { - return $this->service->update($id, $title, $emoji, $archived, $this->userId); + return $this->service->update($id, $title, $emoji, null, $archived, $this->userId); }); } } diff --git a/lib/Db/Table.php b/lib/Db/Table.php index 2ff61fb5c..8877d04bb 100644 --- a/lib/Db/Table.php +++ b/lib/Db/Table.php @@ -67,7 +67,7 @@ class Table extends Entity implements JsonSerializable { protected ?int $columnsCount = 0; protected ?array $views = null; protected ?array $columns = null; - protected ?string $description = null; + protected ?string $description = null; public function __construct() { $this->addType('id', 'integer'); diff --git a/lib/Service/TableService.php b/lib/Service/TableService.php index 9d1f6a86c..7f6dec1f8 100644 --- a/lib/Service/TableService.php +++ b/lib/Service/TableService.php @@ -431,7 +431,7 @@ public function delete(int $id, ?string $userId = null): Table { * @throws NotFoundError * @throws PermissionError */ - public function update(int $id, ?string $title, ?string $emoji, ?string $description,?bool $archived = null, ?string $userId = null): Table { + public function update(int $id, ?string $title, ?string $emoji, ?string $description, ?bool $archived = null, ?string $userId = null): Table { $userId = $this->permissionsService->preCheckUserId($userId); try {