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.

InvalidInputForState   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 46
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getInput() 0 4 1
A getState() 0 4 1
1
<?php
2
3
declare (strict_types = 1);
4
5
namespace Noodle\Transition\Table\Exception;
6
7
use Noodle\State\State;
8
use Noodle\Statemachine\Exception;
9
use Noodle\Transition\Input\Input;
10
11
class InvalidInputForState extends Exception
12
{
13
    /**
14
     * @var Input
15
     */
16
    private $input;
17
18
    /**
19
     * @var State
20
     */
21
    private $state;
22
23
    /**
24
     * Prepares exception message that includes the invalid input and state
25
     *
26
     * @param Input $input
27
     * @param State $state
28
     */
29 2
    public function __construct(Input $input, State $state)
30
    {
31 2
        $this->input = $input;
32 2
        $this->state = $state;
33
34 2
        parent::__construct(sprintf('Cannot %s a %s object', $input->getName(), $state->getName()));
35 2
    }
36
37
    /**
38
     * Returns the input that was attempted.
39
     *
40
     * @return Input
41
     */
42 1
    public function getInput() : Input
43
    {
44 1
        return $this->input;
45
    }
46
47
    /**
48
     * Returns what the object's current state was.
49
     *
50
     * @return State
51
     */
52 1
    public function getState() : State
53
    {
54 1
        return $this->state;
55
    }
56
}
57