@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function interval() |
13 | 13 | { |
14 | - return (int)(static::GLOBAL_TIMER_LOCK_SECONDS * 0.9) * 1000; |
|
14 | + return (int) (static::GLOBAL_TIMER_LOCK_SECONDS * 0.9) * 1000; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function isImmediate() |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public static function getGlobalTimerCacheKey() |
94 | 94 | { |
95 | - return 'laravels:timer:' . strtolower(self::$globalTimerLockKey); |
|
95 | + return 'laravels:timer:'.strtolower(self::$globalTimerLockKey); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | public static function getGlobalTimerLock() |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $expire = self::GLOBAL_TIMER_LOCK_SECONDS; |
106 | 106 | $result = $redis->set($key, $value, 'ex', $expire, 'nx'); |
107 | 107 | // Compatible with Predis and PhpRedis |
108 | - return $result === true || ((string)$result === 'OK'); |
|
108 | + return $result === true || ((string) $result === 'OK'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected static function getCurrentInstanceId() |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | /**@var \Illuminate\Redis\Connections\PhpRedisConnection $redis */ |
119 | 119 | $redis = app('redis'); |
120 | - return (bool)$redis->exists(self::getGlobalTimerCacheKey()); |
|
120 | + return (bool) $redis->exists(self::getGlobalTimerCacheKey()); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | public static function isCurrentTimerAlive() |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | /**@var \Illuminate\Redis\Connections\PhpRedisConnection $redis */ |
135 | 135 | $redis = app('redis'); |
136 | - return (bool)$redis->expire(self::getGlobalTimerCacheKey(), $expire); |
|
136 | + return (bool) $redis->expire(self::getGlobalTimerCacheKey(), $expire); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | public static function setGlobalTimerLockKey($lockKey) |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | |
144 | 144 | public static function setEnable($enable) |
145 | 145 | { |
146 | - self::$enable = (bool)$enable; |
|
146 | + self::$enable = (bool) $enable; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | public static function isEnable() |
@@ -11,7 +11,7 @@ |
||
11 | 11 | { |
12 | 12 | public function interval() |
13 | 13 | { |
14 | - return (int)(static::GLOBAL_TIMER_LOCK_SECONDS * 0.9) * 1000; |
|
14 | + return (int) (static::GLOBAL_TIMER_LOCK_SECONDS * 0.9) * 1000; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | public function isImmediate() |