Skip to content

Commit b8f9b4a

Browse files
committed
ensure both variables are set
1 parent 10d0ea6 commit b8f9b4a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Illuminate/Foundation/Bus/PendingDispatch.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,18 @@ public function __construct($job)
3939
$this->setQueueAndConnectionFromAttributesIfNotSet();
4040
}
4141

42+
/**
43+
* Set the job's queue and connection values based on the job's OnQueue/OnConnection attributes.
44+
*
45+
* @return void
46+
* @throws \ReflectionException
47+
*/
4248
protected function setQueueAndConnectionFromAttributesIfNotSet(): void
4349
{
44-
if (($hasQueueSet = isset($this->job->queue))
45-
&& ($hasConnectionSet = isset($this->job->connection))) {
50+
$hasQueueSet = isset($this->job->queue);
51+
$hasConnectionSet = isset($this->job->connection);
52+
53+
if ($hasQueueSet && $hasConnectionSet) {
4654
return;
4755
}
4856

0 commit comments

Comments
 (0)