File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -40,10 +40,7 @@ public function __construct(
4040
4141 public function getChannel (): string
4242 {
43- if ($ this ->adapter === null ) {
44- throw new LogicException ('Adapter is not set. ' );
45- }
46-
43+ $ this ->checkAdapter ();
4744 return $ this ->adapter ->getChannel ();
4845 }
4946
@@ -86,7 +83,6 @@ public function run(int $max = 0): int
8683 return true ;
8784 };
8885
89- /** @psalm-suppress PossiblyNullReference */
9086 $ this ->adapter ->runExisting ($ handlerCallback );
9187
9288 $ this ->logger ->info (
@@ -102,16 +98,13 @@ public function listen(): void
10298 $ this ->checkAdapter ();
10399
104100 $ this ->logger ->info ('Start listening to the queue. ' );
105- /** @psalm-suppress PossiblyNullReference */
106101 $ this ->adapter ->subscribe (fn (MessageInterface $ message ) => $ this ->handle ($ message ));
107102 $ this ->logger ->info ('Finish listening to the queue. ' );
108103 }
109104
110105 public function status (string |int $ id ): JobStatus
111106 {
112107 $ this ->checkAdapter ();
113-
114- /** @psalm-suppress PossiblyNullReference */
115108 return $ this ->adapter ->status ($ id );
116109 }
117110
@@ -146,6 +139,9 @@ private function handle(MessageInterface $message): bool
146139 return $ this ->loop ->canContinue ();
147140 }
148141
142+ /**
143+ * @psalm-assert AdapterInterface $this->adapter
144+ */
149145 private function checkAdapter (): void
150146 {
151147 if ($ this ->adapter === null ) {
You can’t perform that action at this time.
0 commit comments