Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
18 | public function render(State $state) |
||
19 | { |
||
20 | $graph = ''; |
||
21 | $color = static::COMMAND_COLOR; |
||
22 | |||
23 | foreach ($state->getTransitions() as $transition) { |
||
24 | /** |
||
25 | * @var State $targetState |
||
26 | */ |
||
27 | $targetState = $transition->getObj(); |
||
28 | if ($targetState->getKey() === $state->getKey()) { |
||
29 | $graph .= ' edge[dir="back",style="solid",color="' . $color . '"] state_' |
||
30 | . $state->getKey() . ' -> state_' . $state->getKey() . ';' . PHP_EOL; |
||
31 | } else { |
||
32 | $graph .= ' edge[dir="forward",style="solid",color="' . $color . '"] state_' |
||
33 | . $state->getKey() . ' -> state_' . $targetState->getKey() . ' ;' . PHP_EOL; |
||
34 | } |
||
35 | } |
||
36 | |||
37 | return $graph; |
||
38 | } |
||
39 | } |
||
40 |