Passed
Push — master ( 4da179...4cded1 )
by Yannick
02:33
created

ReadOnlyTransition   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
dl 0
loc 35
ccs 6
cts 10
cp 0.6
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A onRegister() 0 3 1
A __construct() 0 4 1
A getDestinationState() 0 3 1
1
<?php
2
3
namespace Star\Component\State\Transitions;
4
5
use Star\Component\State\RegistryBuilder;
6
use Star\Component\State\StateTransition;
7
use Webmozart\Assert\Assert;
8
9
final class ReadOnlyTransition implements StateTransition
10
{
11
    /**
12
     * @var string
13
     */
14
    private $destination;
15
16
    /**
17
     * @param string $destination
18
     */
19 30
    public function __construct($destination)
20
    {
21 30
        Assert::string($destination);
22 30
        $this->destination = $destination;
23 30
    }
24
25
    public function getName()
26
    {
27
        throw new \RuntimeException('Method ' . __METHOD__ . ' not implemented yet.');
28
    }
29
30
    /**
31
     * @param RegistryBuilder $registry
32
     */
33
    public function onRegister(RegistryBuilder $registry)
34
    {
35
        throw new \RuntimeException('Method ' . __METHOD__ . ' not implemented yet.');
36
    }
37
38
    /**
39
     * @return string
40
     */
41 29
    public function getDestinationState()
42
    {
43 29
        return $this->destination;
44
    }
45
}
46