Deleting parameter-types of methods (lack of support in PHP 5.6)

This commit is contained in:
Philipp Holzer 2018-06-28 23:06:14 +02:00
parent 4b7be15560
commit ad5ee75159
No known key found for this signature in database
GPG key ID: 58160D7D6AF942B6
6 changed files with 13 additions and 13 deletions

View file

@ -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':

View file

@ -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]);
}

View file

@ -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);

View file

@ -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()]);

View file

@ -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

View file

@ -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;