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

NullCallback::onFailure()   A

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
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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