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 ( e189ab...b5f9de )
by Baptiste
01:57
created

Qos   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 39
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 3
A global() 0 7 1
A prefetchSize() 0 4 1
A prefetchCount() 0 4 1
A isGlobal() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\AMQP\Model\Basic;
5
6
use Innmind\AMQP\Exception\DomainException;
7
8
/**
9
 * Quality of service
10
 */
11
final class Qos
12
{
13
    private $prefetchSize;
14
    private $prefetchCount;
15
    private $global = false;
16
17 4
    public function __construct(int $prefetchSize, int $prefetchCount)
18
    {
19 4
        if ($prefetchSize < 0 || $prefetchCount < 0) {
20 2
            throw new DomainException;
21
        }
22
23 2
        $this->prefetchSize = $prefetchSize;
24 2
        $this->prefetchCount = $prefetchCount;
25 2
    }
26
27 1
    public static function global(int $prefetchSize, int $prefetchCount): self
28
    {
29 1
        $self = new self($prefetchSize, $prefetchCount);
30 1
        $self->global = true;
31
32 1
        return $self;
33
    }
34
35 2
    public function prefetchSize(): int
36
    {
37 2
        return $this->prefetchSize;
38
    }
39
40 2
    public function prefetchCount(): int
41
    {
42 2
        return $this->prefetchCount;
43
    }
44
45 2
    public function isGlobal(): bool
46
    {
47 2
        return $this->global;
48
    }
49
}
50