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 — master ( 37b5aa...425f16 )
by Cees-Jan
01:31
created

State::onNext()   A

Complexity

Conditions 4
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.9666
c 0
b 0
f 0
cc 4
nc 2
nop 1
crap 4
1
<?php declare(strict_types=1);
2
3
namespace WyriHaximus\Recoil;
4
5
use Rx\Subject\Subject;
6
7
final class State extends Subject
8
{
9
    public const CREATED = 0;
10
    public const STARTED = 1;
11
    public const WAITING = 2;
12
    public const BUSY    = 3;
13
    public const DONE    = 4;
14
15
    private $state = self::CREATED;
16
17 11
    public function onNext($state)
18
    {
19 11
        if (!is_int($state) || $state < 0 || $state > 4) {
20 5
            throw InvalidStateException::create($state);
21
        }
22
23 6
        $this->state = $state;
24 6
        parent::onNext($state);
25 6
    }
26
27 5
    public function getState(): int
28
    {
29 5
        return $this->state;
30
    }
31
}
32