diff options
Diffstat (limited to 'apps/testing/lib/Locking/FakeDBLockingProvider.php')
-rw-r--r-- | apps/testing/lib/Locking/FakeDBLockingProvider.php | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php index 5f8ea399477..f77bacc7a63 100644 --- a/apps/testing/lib/Locking/FakeDBLockingProvider.php +++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php @@ -1,57 +1,35 @@ <?php + /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Joas Schilling <coding@schilljs.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ namespace OCA\Testing\Locking; +use OC\Lock\DBLockingProvider; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IDBConnection; -use Psr\Log\LoggerInterface; -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 + 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( |