Workflow::getStateName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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