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

RabbitMQQueue   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 50
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 50
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfig() 0 3 1
A setName() 0 5 1
A __construct() 0 4 1
A setConfig() 0 5 1
A getName() 0 3 1
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