| Total Complexity | 5 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class RabbitMQExchange |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Exchange name. |
||
| 11 | * |
||
| 12 | * @var string $name |
||
| 13 | */ |
||
| 14 | protected string $name; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Exchange config. |
||
| 18 | * |
||
| 19 | * @var Collection $config |
||
| 20 | */ |
||
| 21 | protected Collection $config; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Create a new RabbitMQ Exchange instance. |
||
| 25 | * |
||
| 26 | * @param string $name |
||
| 27 | * @param array $config |
||
| 28 | */ |
||
| 29 | public function __construct(string $name, array $config = []) |
||
| 30 | { |
||
| 31 | $this |
||
| 32 | ->setName($name) |
||
| 33 | ->setConfig($config); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get Exchange name. |
||
| 38 | * |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | public function getName(): string |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Set Exchange name. |
||
| 48 | * |
||
| 49 | * @param string $name |
||
| 50 | * |
||
| 51 | * @return RabbitMQExchange |
||
| 52 | */ |
||
| 53 | public function setName(string $name): self |
||
| 54 | { |
||
| 55 | $this->name = $name; |
||
| 56 | |||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Get Exchange Config. |
||
| 62 | * |
||
| 63 | * @return Collection |
||
| 64 | */ |
||
| 65 | public function getConfig(): Collection |
||
| 66 | { |
||
| 67 | return $this->config; |
||
| 68 | } |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Set Exchange config. |
||
| 72 | * |
||
| 73 | * @param array $config |
||
| 74 | * |
||
| 75 | * @return RabbitMQExchange |
||
| 76 | */ |
||
| 77 | public function setConfig(array $config): self |
||
| 82 | } |
||
| 83 | } |
||
| 84 |