diff options
author | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-10-17 15:42:21 +0200 |
---|---|---|
committer | Git'Fellow <12234510+solracsf@users.noreply.github.com> | 2024-10-17 20:30:47 +0200 |
commit | a1681b0756ef784ef7056a3aae3e569a6dcae00e (patch) | |
tree | 13ad313771c95cfba750ca3f21048341c0e75105 /apps/files_sharing | |
parent | 40fd76f69e601ab5579e8ce9b81318d3924dd463 (diff) | |
download | nextcloud-server-a1681b0756ef784ef7056a3aae3e569a6dcae00e.tar.gz nextcloud-server-a1681b0756ef784ef7056a3aae3e569a6dcae00e.zip |
chore(db): Apply query prepared statementsdbQueriesExecStmt2
Fix: psalm
fix: bad file
fix: bug
chore: add batch
chore: add batch
chore: add batch
fix: psalm
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Migration/SetAcceptedStatus.php | 16 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/File.php | 10 |
2 files changed, 10 insertions, 16 deletions
diff --git a/apps/files_sharing/lib/Migration/SetAcceptedStatus.php b/apps/files_sharing/lib/Migration/SetAcceptedStatus.php index 43a3c4aad74..4da6aad4b33 100644 --- a/apps/files_sharing/lib/Migration/SetAcceptedStatus.php +++ b/apps/files_sharing/lib/Migration/SetAcceptedStatus.php @@ -17,16 +17,10 @@ use OCP\Share\IShare; class SetAcceptedStatus implements IRepairStep { - /** @var IDBConnection */ - private $connection; - - /** @var IConfig */ - private $config; - - - public function __construct(IDBConnection $connection, IConfig $config) { - $this->connection = $connection; - $this->config = $config; + public function __construct( + private IDBConnection $connection, + private IConfig $config, + ) { } /** @@ -52,7 +46,7 @@ class SetAcceptedStatus implements IRepairStep { ->update('share') ->set('accepted', $query->createNamedParameter(IShare::STATUS_ACCEPTED)) ->where($query->expr()->in('share_type', $query->createNamedParameter([IShare::TYPE_USER, IShare::TYPE_GROUP, IShare::TYPE_USERGROUP], IQueryBuilder::PARAM_INT_ARRAY))); - $query->execute(); + $query->executeStatement(); } protected function shouldRun() { diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php index 0b7ec58aef3..56a4aa47e60 100644 --- a/apps/files_sharing/lib/ShareBackend/File.php +++ b/apps/files_sharing/lib/ShareBackend/File.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -27,10 +28,9 @@ class File implements Share_Backend_File_Dependent { private $path; - /** @var FederatedShareProvider */ - private $federatedShareProvider; - - public function __construct(?FederatedShareProvider $federatedShareProvider = null) { + public function __construct( + private ?FederatedShareProvider $federatedShareProvider = null, + ) { if ($federatedShareProvider) { $this->federatedShareProvider = $federatedShareProvider; } else { @@ -189,7 +189,7 @@ class File implements Share_Backend_File_Dependent { ->where( $qb->expr()->eq('id', $qb->createNamedParameter($parent)) ); - $result = $qb->execute(); + $result = $qb->executeQuery(); $item = $result->fetch(); $result->closeCursor(); if (isset($item['parent'])) { |