From 5cd1880daa048a685da689c7f41a2e50486494de Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 15 Feb 2021 22:32:56 +0100 Subject: [PATCH] Fix a few RedundantCast Reported by psalm For #25641 Signed-off-by: Roeland Jago Douma --- apps/federation/lib/DbHandler.php | 2 +- apps/files_external/lib/Service/DBConfigService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/federation/lib/DbHandler.php b/apps/federation/lib/DbHandler.php index 5499b4547b..ebff671c21 100644 --- a/apps/federation/lib/DbHandler.php +++ b/apps/federation/lib/DbHandler.php @@ -87,7 +87,7 @@ class DbHandler { $result = $query->execute(); if ($result) { - return (int)$this->connection->lastInsertId('*PREFIX*'.$this->dbTable); + return $query->getLastInsertId(); } $message = 'Internal failure, Could not add trusted server: ' . $url; diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php index 619cd4d71a..3530b0fa4f 100644 --- a/apps/files_external/lib/Service/DBConfigService.php +++ b/apps/files_external/lib/Service/DBConfigService.php @@ -267,7 +267,7 @@ class DBConfigService { 'type' => $builder->createNamedParameter($type, IQueryBuilder::PARAM_INT) ]); $query->execute(); - return (int)$this->connection->lastInsertId('*PREFIX*external_mounts'); + return $query->getLastInsertId(); } /**