diff options
Diffstat (limited to 'lib/private/Lock/AbstractLockingProvider.php')
-rw-r--r-- | lib/private/Lock/AbstractLockingProvider.php | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/lib/private/Lock/AbstractLockingProvider.php b/lib/private/Lock/AbstractLockingProvider.php index 6e8289db12e..d7e5976079c 100644 --- a/lib/private/Lock/AbstractLockingProvider.php +++ b/lib/private/Lock/AbstractLockingProvider.php @@ -1,28 +1,10 @@ <?php declare(strict_types=1); - /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Christoph Wurst <christoph@winzerhof-wurst.at> - * @author Robin Appelman <robin@icewind.nl> - * @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: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ namespace OC\Lock; @@ -33,14 +15,20 @@ use OCP\Lock\ILockingProvider; * to release any leftover locks at the end of the request */ abstract class AbstractLockingProvider implements ILockingProvider { - /** how long until we clear stray locks in seconds */ - protected int $ttl; - - protected $acquiredLocks = [ + protected array $acquiredLocks = [ 'shared' => [], 'exclusive' => [] ]; + /** + * + * @param int $ttl how long until we clear stray locks in seconds + */ + public function __construct( + protected int $ttl, + ) { + } + /** @inheritDoc */ protected function hasAcquiredLock(string $path, int $type): bool { if ($type === self::LOCK_SHARED) { |