SalesWorkflow   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 33
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 30 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: davis
5
 * Date: 1/23/19
6
 * Time: 10:31 AM
7
 */
8
9
namespace Davispeixoto\Workflow\Tests\Auxiliary;
10
11
use Davispeixoto\Workflow\Transition;
12
use Davispeixoto\Workflow\AbstractWorkflow;
13
14
class SalesWorkflow extends AbstractWorkflow
15
{
16
    public function __construct(SalesStates $initialStatus)
17
    {
18
        parent::__construct($initialStatus);
19
20
        $transitions = [];
21
22
        $transitions[] = new Transition(
23
            new SalesStates(SalesStates::NEW),
24
            new SalesStates(SalesStates::DEALING)
25
        );
26
27
        $transitions[] = new Transition(
28
            new SalesStates(SalesStates::DEALING),
29
            new SalesStates(SalesStates::WON)
30
        );
31
32
        $transitions[] = new Transition(
33
            new SalesStates(SalesStates::DEALING),
34
            new SalesStates(SalesStates::LOST)
35
        );
36
37
        $this->allowedTransitions = $transitions;
38
39
        $finished = [];
40
41
        $finished[] = new SalesStates(SalesStates::WON);
42
        $finished[] = new SalesStates(SalesStates::LOST);
43
44
        $this->finishedStatus = $finished;
45
    }
46
}
47