@@ -66,7 +66,7 @@ class JobManager
6666 * @return void
6767 * @api
6868 */
69- public function queue ($ queueName , JobInterface $ job , array $ options = [])
69+ public function queue (string $ queueName , JobInterface $ job , array $ options = []): void
7070 {
7171 $ queue = $ this ->queueManager ->getQueue ($ queueName );
7272
@@ -85,7 +85,7 @@ public function queue($queueName, JobInterface $job, array $options = [])
8585 * @throws \Exception
8686 * @api
8787 */
88- public function waitAndExecute ($ queueName , $ timeout = null )
88+ public function waitAndExecute (string $ queueName , $ timeout = null ): ? Message
8989 {
9090 $ queue = $ this ->queueManager ->getQueue ($ queueName );
9191 $ message = $ queue ->waitAndReserve ($ timeout );
@@ -133,7 +133,7 @@ public function waitAndExecute($queueName, $timeout = null)
133133 * @throws JobQueueException
134134 * @internal This method has to be public so that it can be run from the command handler (when "executeIsolated" is set). It is not meant to be called from "user land"
135135 */
136- public function executeJobForMessage (QueueInterface $ queue , Message $ message )
136+ public function executeJobForMessage (QueueInterface $ queue , Message $ message ): void
137137 {
138138 // TODO stabilize unserialize() call (maybe using PHPs unserialize_callback_func directive)
139139 $ job = unserialize ($ message ->getPayload ());
@@ -153,7 +153,7 @@ public function executeJobForMessage(QueueInterface $queue, Message $message)
153153 * @return JobInterface[]
154154 * @api
155155 */
156- public function peek ($ queueName , $ limit = 1 )
156+ public function peek (string $ queueName , int $ limit = 1 ): array
157157 {
158158 $ queue = $ this ->queueManager ->getQueue ($ queueName );
159159 $ messages = $ queue ->peek ($ limit );
@@ -174,7 +174,7 @@ public function peek($queueName, $limit = 1)
174174 * @Flow\Signal
175175 * @api
176176 */
177- protected function emitMessageSubmitted (QueueInterface $ queue , $ messageId , $ payload , array $ options = [])
177+ protected function emitMessageSubmitted (QueueInterface $ queue , $ messageId , $ payload , array $ options = []): void
178178 {
179179 }
180180
@@ -186,7 +186,7 @@ protected function emitMessageSubmitted(QueueInterface $queue, $messageId, $payl
186186 * @Flow\Signal
187187 * @api
188188 */
189- protected function emitMessageTimeout (QueueInterface $ queue )
189+ protected function emitMessageTimeout (QueueInterface $ queue ): void
190190 {
191191 }
192192
@@ -199,7 +199,7 @@ protected function emitMessageTimeout(QueueInterface $queue)
199199 * @Flow\Signal
200200 * @api
201201 */
202- protected function emitMessageReserved (QueueInterface $ queue , Message $ message )
202+ protected function emitMessageReserved (QueueInterface $ queue , Message $ message ): void
203203 {
204204 }
205205
@@ -212,7 +212,7 @@ protected function emitMessageReserved(QueueInterface $queue, Message $message)
212212 * @Flow\Signal
213213 * @api
214214 */
215- protected function emitMessageFinished (QueueInterface $ queue , Message $ message )
215+ protected function emitMessageFinished (QueueInterface $ queue , Message $ message ): void
216216 {
217217 }
218218
@@ -227,7 +227,7 @@ protected function emitMessageFinished(QueueInterface $queue, Message $message)
227227 * @Flow\Signal
228228 * @api
229229 */
230- protected function emitMessageReleased (QueueInterface $ queue , Message $ message , array $ releaseOptions , \Exception $ jobExecutionException = null )
230+ protected function emitMessageReleased (QueueInterface $ queue , Message $ message , array $ releaseOptions , \Exception $ jobExecutionException = null ): void
231231 {
232232 }
233233
@@ -241,7 +241,7 @@ protected function emitMessageReleased(QueueInterface $queue, Message $message,
241241 * @Flow\Signal
242242 * @api
243243 */
244- protected function emitMessageFailed (QueueInterface $ queue , Message $ message , \Exception $ jobExecutionException = null )
244+ protected function emitMessageFailed (QueueInterface $ queue , Message $ message , \Exception $ jobExecutionException = null ): void
245245 {
246246 }
247247
0 commit comments