RabbitMQQueue   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 1
A getConfig() 0 3 1
A setName() 0 5 1
A setConfig() 0 5 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
     * @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
$config of type array is incompatible with the type Illuminate\Contracts\Support\Arrayable expected by parameter $items of Illuminate\Support\Collection::__construct(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

52
        $this->config = new Collection(/** @scrutinizer ignore-type */ $config);
Loading history...
53
54
        return $this;
55
    }
56
}
57