GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( 09e31d...61c73d )
by Baptiste
01:48
created

Consume   A

Complexity

Total Complexity 20

Size/Duplication

Total Lines 153
Duplicated Lines 0 %

Coupling/Cohesion

Components 6
Dependencies 1

Test Coverage

Coverage 93.75%

Importance

Changes 0
Metric Value
wmc 20
lcom 6
cbo 1
dl 0
loc 153
c 0
b 0
f 0
ccs 60
cts 64
cp 0.9375
rs 9.0909

20 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A withConsumerTag() 0 7 1
A withAutoGeneratedConsumerTag() 0 7 1
A noLocal() 0 7 1
A local() 0 7 1
A manualAcknowledge() 0 7 1
A autoAcknowledge() 0 7 1
A exclusive() 0 7 1
A notExclusive() 0 7 1
A dontWait() 0 7 1
A wait() 0 7 1
A withArgument() 0 7 1
A queue() 0 4 1
A shouldAutoGenerateConsumerTag() 0 4 1
A isLocal() 0 4 1
A shouldAutoAcknowledge() 0 4 1
A isExclusive() 0 4 1
A shouldWait() 0 4 1
A arguments() 0 4 1
A consumerTag() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Model\Basic;
5
6
use Innmind\Immutable\{
7
    MapInterface,
8
    Map
9
};
10
11
final class Consume
12
{
13
    private $queue;
14
    private $consumerTag;
15
    private $local = true;
16
    private $ack = true;
17
    private $exclusive = false;
18
    private $wait = true;
19
    private $arguments;
20
21 7
    public function __construct(string $queue)
22
    {
23 7
        $this->queue = $queue;
24 7
        $this->arguments = new Map('string', 'mixed');
25 7
    }
26
27 2
    public function withConsumerTag(string $tag): self
28
    {
29 2
        $self = clone $this;
30 2
        $self->consumerTag = $tag;
31
32 2
        return $self;
33
    }
34
35
    /**
36
     * Let the server define the consumer tag
37
     */
38 1
    public function withAutoGeneratedConsumerTag(): self
39
    {
40 1
        $self = clone $this;
41 1
        $self->consumerTag = null;
42
43 1
        return $self;
44
    }
45
46
    /**
47
     * Means the server will not deliver messages to the consumer
48
     */
49 2
    public function noLocal(): self
50
    {
51 2
        $self = clone $this;
52 2
        $self->local = false;
53
54 2
        return $self;
55
    }
56
57 1
    public function local(): self
58
    {
59 1
        $self = clone $this;
60 1
        $self->local = true;
61
62 1
        return $self;
63
    }
64
65 1
    public function manualAcknowledge(): self
66
    {
67 1
        $self = clone $this;
68 1
        $self->ack = true;
69
70 1
        return $self;
71
    }
72
73 2
    public function autoAcknowledge(): self
74
    {
75 2
        $self = clone $this;
76 2
        $self->ack = false;
77
78 2
        return $self;
79
    }
80
81 2
    public function exclusive(): self
82
    {
83 2
        $self = clone $this;
84 2
        $self->exclusive = true;
85
86 2
        return $self;
87
    }
88
89 1
    public function notExclusive(): self
90
    {
91 1
        $self = clone $this;
92 1
        $self->exclusive = false;
93
94 1
        return $self;
95
    }
96
97 2
    public function dontWait(): self
98
    {
99 2
        $self = clone $this;
100 2
        $self->wait = false;
101
102 2
        return $self;
103
    }
104
105 1
    public function wait(): self
106
    {
107 1
        $self = clone $this;
108 1
        $self->wait = true;
109
110 1
        return $self;
111
    }
112
113
    public function withArgument(string $key, $value): self
114
    {
115
        $self = clone $this;
116
        $self->arguments = $self->arguments->put($key, $value);
117
118
        return $self;
119
    }
120
121 2
    public function queue(): string
122
    {
123 2
        return $this->queue;
124
    }
125
126 3
    public function shouldAutoGenerateConsumerTag(): bool
127
    {
128 3
        return !is_string($this->consumerTag);
129
    }
130
131 1
    public function consumerTag(): string
132
    {
133 1
        return $this->consumerTag;
134
    }
135
136 3
    public function isLocal(): bool
137
    {
138 3
        return $this->local;
139
    }
140
141 3
    public function shouldAutoAcknowledge(): bool
142
    {
143 3
        return !$this->ack;
144
    }
145
146 3
    public function isExclusive(): bool
147
    {
148 3
        return $this->exclusive;
149
    }
150
151 3
    public function shouldWait(): bool
152
    {
153 3
        return $this->wait;
154
    }
155
156
    /**
157
     * @return MapInterface<string, mixed>
0 ignored issues
show
Documentation introduced by
The doc-type MapInterface<string, could not be parsed: Expected "|" or "end of type", but got "<" at position 12. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
158
     */
159 1
    public function arguments(): MapInterface
160
    {
161 1
        return $this->arguments;
162
    }
163
}
164