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   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onNext() 0 9 4
A getState() 0 4 1
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