Skip to content

Commit

Permalink
fix php linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: grnd-alt <salimbelakkaf@outlook.de>
  • Loading branch information
grnd-alt committed Mar 18, 2024
1 parent 03ca544 commit bdc9920
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lib/Command/RenameTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/Api1Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()];
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ApiTablesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/TableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
}
2 changes: 1 addition & 1 deletion lib/Db/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/TableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bdc9920

Please sign in to comment.