ViewAction   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 8
c 2
b 0
f 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A run() 0 3 1
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