Workflow::getStateName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php 
2
3
namespace Jawaraegov\Workflows;
4
5
use Jawaraegov\Workflows\Models\WorkflowTransition;
6
use Jawaraegov\Workflows\Models\WorkflowState;
7
use That0n3guy\Transliteration;
8
use Illuminate\Http\Request;
9
/**
10
 * The Workflows class.
11
 *
12
 * @package Jawaraegov\Workflows
13
 * @author  Jawaraegov <[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 Jawaraegov\Workflows 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