summaryrefslogtreecommitdiffstats
path: root/apps/testing/lib
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-04-22 15:00:20 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-05-12 15:09:58 +0200
commitfcae6a68c347e2913cc29f45648be37789f09c29 (patch)
tree5b1b58b359b424497b86abe870437ae4342ee0ce /apps/testing/lib
parent9a76f06ecadf05ef1d26bd735df1bea0dfb15d59 (diff)
downloadnextcloud-server-fcae6a68c347e2913cc29f45648be37789f09c29.tar.gz
nextcloud-server-fcae6a68c347e2913cc29f45648be37789f09c29.zip
Cleanup lock related code
- Port to QueryBuilder - Improve the doc a bit - Add type hinting Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/testing/lib')
-rw-r--r--apps/testing/lib/Locking/FakeDBLockingProvider.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php
index 5f8ea399477..2556ba29a64 100644
--- a/apps/testing/lib/Locking/FakeDBLockingProvider.php
+++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php
@@ -26,32 +26,27 @@ namespace OCA\Testing\Locking;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IDBConnection;
use Psr\Log\LoggerInterface;
+use OC\Lock\DBLockingProvider;
-class FakeDBLockingProvider extends \OC\Lock\DBLockingProvider {
+class FakeDBLockingProvider extends DBLockingProvider {
// Lock for 10 hours just to be sure
public const TTL = 36000;
/**
* Need a new child, because parent::connection is private instead of protected...
- * @var IDBConnection
*/
- protected $db;
+ protected IDBConnection $db;
public function __construct(
IDBConnection $connection,
- LoggerInterface $logger,
ITimeFactory $timeFactory
) {
- parent::__construct($connection, $logger, $timeFactory);
+ parent::__construct($connection, $timeFactory);
$this->db = $connection;
}
-
- /**
- * @param string $path
- * @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE
- */
- public function releaseLock(string $path, int $type) {
+ /** @inheritDoc */
+ public function releaseLock(string $path, int $type): void {
// we DONT keep shared locks till the end of the request
if ($type === self::LOCK_SHARED) {
$this->db->executeUpdate(