Passed
Branch master (74fab5)
by Kunal
03:19
created

RabbitMQQueue::setConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
rs 10
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
     *
30
     * @return \Kunnu\RabbitMQ\RabbitMQQueue
31
     */
32
    public function setName(string $name): self
33
    {
34
        $this->name = $name;
35
36
        return $this;
37
    }
38
39
    /**
40
     * @return Collection
41
     */
42
    public function getConfig(): Collection
43
    {
44
        return $this->config;
45
    }
46
47
    /**
48
     * @param array $config
49
     *
50
     * @return \Kunnu\RabbitMQ\RabbitMQQueue
51
     */
52
    public function setConfig(array $config): self
53
    {
54
        $this->config = new Collection($config);
55
56
        return $this;
57
    }
58
}
59