Workflow   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 4
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A welcome() 0 4 1
A getStateName() 0 4 1
A getTransitionName() 0 4 1
1
<?php 
2
3
namespace Bantenprov\Workflow;
4
5
use Bantenprov\Workflow\Models\WorkflowTransition;
6
use Bantenprov\Workflow\Models\WorkflowState;
7
use That0n3guy\Transliteration;
8
use Illuminate\Http\Request;
9
/**
10
 * The Workflow class.
11
 *
12
 * @package Bantenprov\Workflow
13
 * @author  bantenprov <[email protected]>
14
 */
15
class Workflow
16
{
17
    protected $workflowTransition;
18
    protected $workflowState;
19
20
    public function __construct()
21
    {
22
        $this->workflowTransition = new WorkflowTransition();
23
        $this->workflowState = new WorkflowState();        
24
    }
25
26
    public function welcome()
27
    {
28
        return 'Welcome to Bantenprov\Workflow package';
29
    }
30
31
    public function getStateName($id)
32
    {
33
        return $this->workflowState->where('id',$id)->first()->name;
34
    }
35
36
    public function getTransitionName($id)
37
    {
38
        return $this->workflowTranstion->where('id',$id)->first()->name;
0 ignored issues
show
Bug introduced by
The property workflowTranstion does not seem to exist. Did you mean workflowTransition?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
39
    }
40
41
    
42
}
43