From d4d1952f673aa21eaa3a99817a762685a77c2e16 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sun, 16 Oct 2022 23:33:52 +0200 Subject: [PATCH] Fix return value of updateParent Port to executeStatement to guarantee that we will return an int and remove a deprecated method call at the same time Signed-off-by: Carl Schwan --- apps/files_external/lib/Command/Notify.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index 91bbd6d3354..2e3ade7df7a 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -292,20 +292,15 @@ class Notify extends Base { ->fetchAll(); } - /** - * @param array $storageIds - * @param string $parent - * @return int - */ - private function updateParent($storageIds, $parent) { - $pathHash = md5(trim(\OC_Util::normalizeUnicode($parent), '/')); + private function updateParent(array $storageIds, string $parent): int { + $pathHash = md5(trim((string)\OC_Util::normalizeUnicode($parent), '/')); $qb = $this->connection->getQueryBuilder(); return $qb ->update('filecache') ->set('size', $qb->createNamedParameter(-1, IQueryBuilder::PARAM_INT)) ->where($qb->expr()->in('storage', $qb->createNamedParameter($storageIds, IQueryBuilder::PARAM_INT_ARRAY, ':storage_ids'))) ->andWhere($qb->expr()->eq('path_hash', $qb->createNamedParameter($pathHash, IQueryBuilder::PARAM_STR))) - ->execute(); + ->executeStatement(); } private function reconnectToDatabase(IDBConnection $connection, OutputInterface $output): IDBConnection { -- 2.39.5