EventBehavior::transition()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dflydev\FiniteStateMachine\Event;
6
7
use Dflydev\FiniteStateMachine\Graph\Graph;
8
use Dflydev\FiniteStateMachine\State\State;
9
use Dflydev\FiniteStateMachine\Transition\Transition;
10
11
trait EventBehavior
12
{
13
    private Graph $graph;
14
    private object $object;
15
    private Transition $transition;
16
    private State $fromState;
17
    private State $toState;
18
19 7
    public function __construct(Graph $graph, object $object, Transition $transition, State $fromState, State $toState)
20
    {
21 7
        $this->graph = $graph;
22 7
        $this->object = $object;
23 7
        $this->transition = $transition;
24 7
        $this->fromState = $fromState;
25 7
        $this->toState = $toState;
26 7
    }
27
28 1
    public function graph(): Graph
29
    {
30 1
        return $this->graph;
31
    }
32
33 7
    public function object(): object
34
    {
35 7
        return $this->object;
36
    }
37
38 7
    public function transition(): Transition
39
    {
40 7
        return $this->transition;
41
    }
42
43 7
    public function fromState(): State
44
    {
45 7
        return $this->fromState;
46
    }
47
48 7
    public function toState(): State
49
    {
50 7
        return $this->toState;
51
    }
52
}
53