55namespace Umbrellio \LaravelHeavyJobs \Stores ;
66
77use Carbon \Carbon ;
8+ use function count ;
89use Illuminate \Redis \RedisManager ;
910use Umbrellio \LaravelHeavyJobs \Stores \Helpers \LuaScripts ;
10- use function \count ;
1111
1212final class RedisStore implements StoreInterface
1313{
@@ -28,15 +28,15 @@ public function get(string $id): ?string
2828 {
2929 $ score = $ this ->lifetime !== -1 ? Carbon::now ()->getTimestamp () : 0 ;
3030
31- [$ payload , $ ids ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id , $ score ) {
31+ [$ payload , $ ids ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id , $ score ): void {
3232 $ pipe ->eval (LuaScripts::get (), [self ::JOB_PAYLOADS_KEY , self ::FAILED_JOB_PAYLOADS_KEY , $ id ], 2 );
33- $ pipe ->zrangebyscore (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , '-inf ' , (string )$ score );
33+ $ pipe ->zrangebyscore (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , '-inf ' , (string ) $ score );
3434 });
3535
3636 if (count ($ ids )) {
37- $ this ->connection ->pipeline (function ($ pipe ) use ($ ids , $ score ) {
37+ $ this ->connection ->pipeline (function ($ pipe ) use ($ ids , $ score ): void {
3838 $ pipe ->hdel (self ::FAILED_JOB_PAYLOADS_KEY , ...$ ids );
39- $ pipe ->zremrangebyscore (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , '-inf ' , (string )$ score );
39+ $ pipe ->zremrangebyscore (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , '-inf ' , (string ) $ score );
4040 });
4141 }
4242
@@ -50,7 +50,7 @@ public function getFailed(string $id): ?string
5050
5151 public function set (string $ id , string $ serializedData ): bool
5252 {
53- [$ set ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id , $ serializedData ) {
53+ [$ set ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id , $ serializedData ): void {
5454 $ pipe ->hset (self ::JOB_PAYLOADS_KEY , $ id , $ serializedData );
5555 $ pipe ->zrem (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , $ id );
5656 });
@@ -70,7 +70,7 @@ public function remove(string $id): bool
7070
7171 public function removeFailed (string $ id ): bool
7272 {
73- [$ deleted ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id ) {
73+ [$ deleted ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id ): void {
7474 $ pipe ->hdel (self ::FAILED_JOB_PAYLOADS_KEY , $ id );
7575 $ pipe ->zrem (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , $ id );
7676 });
@@ -80,7 +80,7 @@ public function removeFailed(string $id): bool
8080
8181 public function markAsFailed (string $ id ): bool
8282 {
83- [$ marked ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id ) {
83+ [$ marked ] = $ this ->connection ->pipeline (function ($ pipe ) use ($ id ): void {
8484 $ pipe ->eval (LuaScripts::markAsFailed (), [self ::JOB_PAYLOADS_KEY , self ::FAILED_JOB_PAYLOADS_KEY , $ id ], 2 );
8585 $ pipe ->zadd (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY , Carbon::now ()->getTimestamp () + $ this ->lifetime , $ id );
8686 });
@@ -90,7 +90,7 @@ public function markAsFailed(string $id): bool
9090
9191 public function flushFailed (): bool
9292 {
93- $ result = $ this ->connection ->pipeline (function ($ pipe ) {
93+ $ result = $ this ->connection ->pipeline (function ($ pipe ): void {
9494 $ pipe ->del (self ::FAILED_JOB_PAYLOADS_KEY );
9595 $ pipe ->del (self ::LIFETIME_FAILED_JOB_PAYLOADS_KEY );
9696 });
0 commit comments