Passed
Pull Request — master (#18)
by
unknown
02:29
created

AuthenticationWorkflow   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 36
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfig() 0 31 1
1
<?php
2
3
namespace LineMob\Core\Mocky\Auth;
4
5
use LineMob\Core\Workflow\AbstractWorkflow;
6
7
class AuthenticationWorkflow extends AbstractWorkflow
8
{
9
    /**
10
     * {@inheritdoc}
11
     */
12
    protected function getConfig()
13
    {
14
        return [
15
            'name' => 'Authentication',
16
            'marking_store' => [
17
                'type' => 'multiple_state',
18
                'arguments' => ['state']
19
            ],
20
            'places' => [
21
                'started',
22
                'wait_for_username',
23
                'wait_for_password',
24
                'wait_for_username_n_password',
25
                'finished'
26
            ],
27
            'transitions' => [
28
                'start' => [
29
                    'from' => 'started',
30
                    'to' => ['wait_for_username_n_password', 'wait_for_username']
31
                ],
32
                'enter_username' => [
33
                    'from' => 'wait_for_username',
34
                    'to' => 'wait_for_password'
35
                ],
36
                'enter_password' => [
37
                    'from' => 'wait_for_password',
38
                    'to' => 'finished'
39
                ],
40
                'enter_username_n_password' => [
41
                    'from' => 'wait_for_username_n_password',
42
                    'to' => 'finished'
43
                ],
44
            ]
45
        ];
46
    }
47
}
48