ViewAction::run()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace MagicLink\Actions;
4
5
class ViewAction extends ActionAbstract
6
{
7
    protected $view;
8
9
    protected $data;
10
11
    protected $mergeData;
12
13
    /**
14
     * Constructor action.
15
     *
16
     * @param  \Illuminate\Contracts\Support\Arrayable|array  $data
17
     * @param  array  $mergeData
18
     */
19
    public function __construct(string $view, $data = [], $mergeData = [])
20
    {
21
        $this->view = $view;
22
23
        $this->data = $data;
24
25
        $this->mergeData = $mergeData;
26
    }
27
28
    /**
29
     * Execute Action.
30
     */
31
    public function run()
32
    {
33
        return view($this->view, $this->data, $this->mergeData);
34
    }
35
}
36