Passed
Push — master ( 26669d...eddd64 )
by
unknown
04:41
created

Consumer   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
eloc 14
c 1
b 0
f 0
dl 0
loc 39
ccs 10
cts 15
cp 0.6667
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setMicrosecondsToSleep() 0 5 1
A microsecondsToSleep() 0 3 1
A handler() 0 3 1
A __construct() 0 5 1
A queue() 0 3 1
A consumerTag() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Umbrellio\TableSync\Rabbit\Config;
6
7
use Umbrellio\TableSync\ReceivedMessageHandler;
8
9
class Consumer
10
{
11
    private $handler;
12
    private $queue;
13
    private $consumerTag;
14
    private $microsecondsToSleep = 1000000;
15
16 1
    public function __construct(ReceivedMessageHandler $handler, string $queue, string $consumerTag = '')
17
    {
18 1
        $this->handler = $handler;
19 1
        $this->queue = $queue;
20 1
        $this->consumerTag = $consumerTag;
21
    }
22
23 1
    public function handler(): ReceivedMessageHandler
24
    {
25 1
        return $this->handler;
26
    }
27
28 1
    public function queue(): string
29
    {
30 1
        return $this->queue;
31
    }
32
33 1
    public function consumerTag(): string
34
    {
35 1
        return $this->consumerTag;
36
    }
37
38
    public function microsecondsToSleep(): int
39
    {
40
        return $this->microsecondsToSleep;
41
    }
42
43
    public function setMicrosecondsToSleep(int $microsecondsToSleep): self
44
    {
45
        $this->microsecondsToSleep = $microsecondsToSleep;
46
47
        return $this;
48
    }
49
}
50