Skip to content

Commit

Permalink
Merge pull request #5 from sajadranjbar/bugfix/custom-event
Browse files Browse the repository at this point in the history
fixed custom event
  • Loading branch information
sajadranjbar authored Sep 14, 2022
2 parents 1b0e4e6 + d86ff38 commit 28da999
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Commands/ConsumeMessages.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct()
$this->events = collect(config('rabbitmq.consumers'))
->mapWithKeys(function ($event) {
if (is_array($event)) {
return [class_basename(array_key_exists(2, $event) ? $event[2] : $event[0]) => $event[0]];
return [class_basename($event[0]) => array_key_exists(2, $event) ? $event[2] : $event[0]];
}

return [class_basename($event) => $event];
Expand All @@ -55,7 +55,7 @@ public function handle(RabbitMQ $rabbitmq)
}

if (is_array($event)) {
$queue->bindTo(class_basename(array_key_exists(2, $event) ? $event[2] : $event[0]), $event[1]);
$queue->bindTo(class_basename($event[0]), $event[1]);
}
}

Expand Down

0 comments on commit 28da999

Please sign in to comment.