]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix return value of updateParent
authorCarl Schwan <carl@carlschwan.eu>
Sun, 16 Oct 2022 21:33:52 +0000 (23:33 +0200)
committerCarl Schwan <carl@carlschwan.eu>
Sun, 16 Oct 2022 21:33:52 +0000 (23:33 +0200)
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 <carl@carlschwan.eu>
apps/files_external/lib/Command/Notify.php

index 91bbd6d33545d7adabd0fd730d1e02927c59a2ec..2e3ade7df7abe5cad4b7ece6b38c74a707102ef3 100644 (file)
@@ -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 {