From: Philipp Holzer Date: Thu, 28 Jun 2018 21:06:14 +0000 (+0200) Subject: Deleting parameter-types of methods (lack of support in PHP 5.6) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ad5ee75159f86010ad0acdf3475eb49f3b9f1192;p=friendica.git Deleting parameter-types of methods (lack of support in PHP 5.6) --- diff --git a/src/Core/Cache/CacheDriverFactory.php b/src/Core/Cache/CacheDriverFactory.php index e9ff4331d7..45cc17a52f 100644 --- a/src/Core/Cache/CacheDriverFactory.php +++ b/src/Core/Cache/CacheDriverFactory.php @@ -20,7 +20,7 @@ class CacheDriverFactory * @return ICacheDriver The instance of the CacheDriver * @throws \Exception The exception if something went wrong during the CacheDriver creation */ - public static function create(string $driver) { + public static function create($driver) { switch ($driver) { case 'memcache': diff --git a/src/Core/Lock/AbstractLockDriver.php b/src/Core/Lock/AbstractLockDriver.php index 4c2bfaec95..bcce26129c 100644 --- a/src/Core/Lock/AbstractLockDriver.php +++ b/src/Core/Lock/AbstractLockDriver.php @@ -22,7 +22,7 @@ abstract class AbstractLockDriver implements ILockDriver * @param string key The Name of the lock * @return bool Returns true if the lock is set */ - protected function hasAcquiredLock(string $key) { + protected function hasAcquiredLock($key) { return isset($this->acquireLock[$key]); } @@ -31,7 +31,7 @@ abstract class AbstractLockDriver implements ILockDriver * * @param string $key The Name of the lock */ - protected function markAcquire(string $key) { + protected function markAcquire($key) { $this->acquiredLocks[$key] = true; } @@ -40,7 +40,7 @@ abstract class AbstractLockDriver implements ILockDriver * * @param string $key The Name of the lock */ - protected function markRelease(string $key) { + protected function markRelease($key) { unset($this->acquiredLocks[$key]); } diff --git a/src/Core/Lock/CacheLockDriver.php b/src/Core/Lock/CacheLockDriver.php index 0adca140d1..1bb768bd0f 100644 --- a/src/Core/Lock/CacheLockDriver.php +++ b/src/Core/Lock/CacheLockDriver.php @@ -30,7 +30,7 @@ class CacheLockDriver extends AbstractLockDriver * * @return boolean Was the lock successful? */ - public function acquireLock(string $key, int $timeout = 120) + public function acquireLock($key, $timeout = 120) { $got_lock = false; $start = time(); @@ -71,7 +71,7 @@ class CacheLockDriver extends AbstractLockDriver * * @return mixed */ - public function releaseLock(string $key) + public function releaseLock($key) { $cachekey = get_app()->get_hostname() . ";lock:" . $key; $lock = $this->cache->get($cachekey); diff --git a/src/Core/Lock/DatabaseLockDriver.php b/src/Core/Lock/DatabaseLockDriver.php index f9878340cf..9b415753fc 100644 --- a/src/Core/Lock/DatabaseLockDriver.php +++ b/src/Core/Lock/DatabaseLockDriver.php @@ -18,7 +18,7 @@ class DatabaseLockDriver extends AbstractLockDriver * * @return boolean Was the lock successful? */ - public function acquireLock(string $key, int $timeout = 120) + public function acquireLock($key, $timeout = 120) { $got_lock = false; $start = time(); @@ -66,7 +66,7 @@ class DatabaseLockDriver extends AbstractLockDriver * * @return mixed */ - public function releaseLock(string $key) + public function releaseLock($key) { dba::delete('locks', ['locked' => false, 'pid' => 0], ['name' => $key, 'pid' => getmypid()]); diff --git a/src/Core/Lock/ILockDriver.php b/src/Core/Lock/ILockDriver.php index 39e4ba8e89..8744d757f1 100644 --- a/src/Core/Lock/ILockDriver.php +++ b/src/Core/Lock/ILockDriver.php @@ -18,7 +18,7 @@ interface ILockDriver * * @return boolean Was the lock successful? */ - public function acquireLock(string $key, int $timeout = 120); + public function acquireLock($key, $timeout = 120); /** * @brief Releases a lock if it was set by us @@ -27,7 +27,7 @@ interface ILockDriver * * @return void */ - public function releaseLock(string $key); + public function releaseLock($key); /** * @brief Releases all lock that were set by us diff --git a/src/Core/Lock/SemaphoreLockDriver.php b/src/Core/Lock/SemaphoreLockDriver.php index 4eb30b9d02..39e3e1d32c 100644 --- a/src/Core/Lock/SemaphoreLockDriver.php +++ b/src/Core/Lock/SemaphoreLockDriver.php @@ -18,7 +18,7 @@ class SemaphoreLockDriver extends AbstractLockDriver * * @return integer the semaphore key */ - private static function semaphoreKey(string $key) + private static function semaphoreKey($key) { $temp = get_temppath(); @@ -40,7 +40,7 @@ class SemaphoreLockDriver extends AbstractLockDriver * * @return boolean Was the lock successful? */ - public function acquireLock(string $key, int $timeout = 120) + public function acquireLock($key, $timeout = 120) { $this->acquiredLocks[$key] = sem_get(self::semaphoreKey($key)); if ($this->acquiredLocks[$key]) { @@ -55,7 +55,7 @@ class SemaphoreLockDriver extends AbstractLockDriver * * @return mixed */ - public function releaseLock(string $key) + public function releaseLock($key) { if (empty($this->acquiredLocks[$key])) { return false;