summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-17 09:33:52 +0100
committerGitHub <noreply@github.com>2018-01-17 09:33:52 +0100
commit22b3280ac2b60e52049a07ada007768e3cef05ed (patch)
tree8cfe1b08a27701869c3d385ec972f0127d40678d /lib/public
parentcb0dbfa987b0fab9ef34a164c7715d93915ebf95 (diff)
parent8edbfdb29173a97f6fd265bad234ec458b72bf40 (diff)
downloadnextcloud-server-22b3280ac2b60e52049a07ada007768e3cef05ed.tar.gz
nextcloud-server-22b3280ac2b60e52049a07ada007768e3cef05ed.zip
Merge pull request #7897 from nextcloud/strict_lockingproviders
Made locking providers strict
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/Lock/ILockingProvider.php9
-rw-r--r--lib/public/Lock/LockedException.php5
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/public/Lock/ILockingProvider.php b/lib/public/Lock/ILockingProvider.php
index 6fe9894b7b5..32e76c72531 100644
--- a/lib/public/Lock/ILockingProvider.php
+++ b/lib/public/Lock/ILockingProvider.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -45,7 +46,7 @@ interface ILockingProvider {
* @return bool
* @since 8.1.0
*/
- public function isLocked($path, $type);
+ public function isLocked(string $path, int $type): bool;
/**
* @param string $path
@@ -53,14 +54,14 @@ interface ILockingProvider {
* @throws \OCP\Lock\LockedException
* @since 8.1.0
*/
- public function acquireLock($path, $type);
+ public function acquireLock(string $path, int $type);
/**
* @param string $path
* @param int $type self::LOCK_SHARED or self::LOCK_EXCLUSIVE
* @since 8.1.0
*/
- public function releaseLock($path, $type);
+ public function releaseLock(string $path, int $type);
/**
* Change the type of an existing lock
@@ -70,7 +71,7 @@ interface ILockingProvider {
* @throws \OCP\Lock\LockedException
* @since 8.1.0
*/
- public function changeLock($path, $targetType);
+ public function changeLock(string $path, int $targetType);
/**
* release all lock acquired by this instance
diff --git a/lib/public/Lock/LockedException.php b/lib/public/Lock/LockedException.php
index 5b5d88c18ca..1378f437c3a 100644
--- a/lib/public/Lock/LockedException.php
+++ b/lib/public/Lock/LockedException.php
@@ -1,4 +1,5 @@
<?php
+declare(strict_types=1);
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -48,7 +49,7 @@ class LockedException extends \Exception {
*
* @since 8.1.0
*/
- public function __construct($path, \Exception $previous = null) {
+ public function __construct(string $path, \Exception $previous = null) {
parent::__construct('"' . $path . '" is locked', 0, $previous);
$this->path = $path;
}
@@ -57,7 +58,7 @@ class LockedException extends \Exception {
* @return string
* @since 8.1.0
*/
- public function getPath() {
+ public function getPath(): string {
return $this->path;
}
}