kunalvarma05 /
laravel-rabbitmq
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Kunnu\RabbitMQ; |
||
| 4 | |||
| 5 | use Illuminate\Support\Collection; |
||
| 6 | |||
| 7 | class RabbitMQQueue |
||
| 8 | { |
||
| 9 | protected string $name; |
||
| 10 | |||
| 11 | protected Collection $config; |
||
| 12 | |||
| 13 | public function __construct(string $name, array $config = []) |
||
| 14 | { |
||
| 15 | $this->setName($name); |
||
| 16 | $this->setConfig($config); |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @return string |
||
| 21 | */ |
||
| 22 | public function getName(): string |
||
| 23 | { |
||
| 24 | return $this->name; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $name |
||
| 29 | * @return \Kunnu\RabbitMQ\RabbitMQQueue |
||
| 30 | */ |
||
| 31 | public function setName(string $name): self |
||
| 32 | { |
||
| 33 | $this->name = $name; |
||
| 34 | |||
| 35 | return $this; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return Collection |
||
| 40 | */ |
||
| 41 | public function getConfig(): Collection |
||
| 42 | { |
||
| 43 | return $this->config; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param array $config |
||
| 48 | * @return \Kunnu\RabbitMQ\RabbitMQQueue |
||
| 49 | */ |
||
| 50 | public function setConfig(array $config): self |
||
| 51 | { |
||
| 52 | $this->config = new Collection($config); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 53 | |||
| 54 | return $this; |
||
| 55 | } |
||
| 56 | } |
||
| 57 |