@@ -37,9 +37,10 @@ public function __construct(
3737 $ this ->adapterPushHandler = new AdapterPushHandler ();
3838 }
3939
40- public function getChannel (): ? string
40+ public function getChannel (): string
4141 {
42- return $ this ->adapter ?->getChannel();
42+ $ this ->checkAdapter ();
43+ return $ this ->adapter ->getChannel ();
4344 }
4445
4546 public function push (
@@ -83,7 +84,6 @@ public function run(int $max = 0): int
8384 return true ;
8485 };
8586
86- /** @psalm-suppress PossiblyNullReference */
8787 $ this ->adapter ->runExisting ($ handlerCallback );
8888
8989 $ this ->logger ->info (
@@ -99,16 +99,13 @@ public function listen(): void
9999 $ this ->checkAdapter ();
100100
101101 $ this ->logger ->info ('Start listening to the queue. ' );
102- /** @psalm-suppress PossiblyNullReference */
103102 $ this ->adapter ->subscribe (fn (MessageInterface $ message ) => $ this ->handle ($ message ));
104103 $ this ->logger ->info ('Finish listening to the queue. ' );
105104 }
106105
107106 public function status (string |int $ id ): JobStatus
108107 {
109108 $ this ->checkAdapter ();
110-
111- /** @psalm-suppress PossiblyNullReference */
112109 return $ this ->adapter ->status ($ id );
113110 }
114111
@@ -143,6 +140,9 @@ private function handle(MessageInterface $message): bool
143140 return $ this ->loop ->canContinue ();
144141 }
145142
143+ /**
144+ * @psalm-assert AdapterInterface $this->adapter
145+ */
146146 private function checkAdapter (): void
147147 {
148148 if ($ this ->adapter === null ) {
0 commit comments