FlowForm::setModule()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Hechoenlaravel\JarvisFoundation\Flows\UI;
4
5
use JavaScript;
6
use Hechoenlaravel\JarvisFoundation\Flows\Flow;
7
8
/**
9
 * Class FlowForm
10
 *
11
 * @package Hechoenlaravel\JarvisFoundation\Flows\UI
12
 */
13
class FlowForm
14
{
15
    /**
16
     * @var null
17
     */
18
    public $flow = null;
19
20
    /**
21
     * @var
22
     */
23
    public $module;
24
25
    /**
26
     * @var
27
     */
28
    public $returnBaseUrl;
29
30
    /**
31
     * @param $module
32
     * @return $this
33
     */
34
    public function setModule($module)
35
    {
36
        $this->module = $module;
37
        return $this;
38
    }
39
40
    /**
41
     * @param $url
42
     * @return $this
43
     */
44
    public function setReturnBaseUrl($url)
45
    {
46
        $this->returnBaseUrl = $url;
47
        return $this;
48
    }
49
50
    /**
51
     * @param $id
52
     * @return $this
53
     */
54
    public function setFlow($id)
55
    {
56
        $this->flow = Flow::findOrFail($id);
57
        return $this;
58
    }
59
60
    /**
61
     * @return string
62
     */
63
    public function render()
64
    {
65
        JavaScript::put([
66
            'module' => $this->module,
67
            'flow' => $this->flow,
68
            'redirectBaseUrl' => $this->returnBaseUrl
69
        ]);
70
        return view('jarvisPlatform::flows.form')->with('flow', $this->flow)->render();
0 ignored issues
show
Bug introduced by
The method with() does not seem to exist on object<BladeView>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
71
    }
72
}
73