Passed
Pull Request — master (#19)
by Yannick
02:27
created

NullCallback::afterStateChange()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 2
dl 0
loc 2
ccs 0
cts 1
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Star\Component\State\Callbacks;
4
5
use Star\Component\State\InvalidStateTransitionException;
6
use Star\Component\State\StateMachine;
7
8
final class NullCallback implements TransitionCallback
9
{
10
    /**
11
     * @param mixed $context
12
     * @param StateMachine $machine
13
     */
14 1
    public function beforeStateChange($context, StateMachine $machine)
15
    {
16 1
    }
17
18
    /**
19
     * @param mixed $context
20
     * @param StateMachine $machine
21
     */
22
    public function afterStateChange($context, StateMachine $machine)
23
    {
24
    }
25
26
    /**
27
     * @param InvalidStateTransitionException $exception
28
     * @param mixed $context
29
     * @param StateMachine $machine
30
     *
31
     * @return string
32
     */
33 1
    public function onFailure(InvalidStateTransitionException $exception, $context, StateMachine $machine)
34
    {
35 1
        throw new \RuntimeException('Method ' . __METHOD__ . ' should never be called.');
36
    }
37
}
38