TransitionConfiguration   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 73
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 73
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getState() 0 4 1
A getEvent() 0 4 1
A getNextState() 0 4 1
A getGuardCallback() 0 4 1
A getGuardName() 0 4 1
1
<?php
2
3
namespace LightFsm;
4
5
class TransitionConfiguration 
6
{
7
    /** @var string|int */
8
    private $state;
9
10
    /** @var string|int */
11
    private $event;
12
13
    /** @var string|int */
14
    private $nextState;
15
16
    /** @var callable|null */
17
    private $guardCallback;
18
19
    /** @var string|null */
20
    private $guardName;
21
22
    /**
23
     * @param string|int    $state
24
     * @param string|int    $event
25
     * @param string|int    $nextState
26
     * @param callable|null $guardCallback
27
     * @param string|null   $guardName
28
     */
29
    public function __construct($state, $event, $nextState, $guardCallback, $guardName)
30
    {
31
        $this->state = $state;
32
        $this->event = $event;
33
        $this->nextState = $nextState;
34
        $this->guardCallback = $guardCallback;
35
        $this->guardName = $guardName;
36
    }
37
38
    /**
39
     * @return int|string
40
     */
41
    public function getState()
42
    {
43
        return $this->state;
44
    }
45
46
    /**
47
     * @return int|string
48
     */
49
    public function getEvent()
50
    {
51
        return $this->event;
52
    }
53
54
    /**
55
     * @return int|string
56
     */
57
    public function getNextState()
58
    {
59
        return $this->nextState;
60
    }
61
62
    /**
63
     * @return callable|null
64
     */
65
    public function getGuardCallback()
66
    {
67
        return $this->guardCallback;
68
    }
69
70
    /**
71
     * @return null|string
72
     */
73
    public function getGuardName()
74
    {
75
        return $this->guardName;
76
    }
77
}
78