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::global()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 2
crap 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