Completed
Pull Request — master (#14)
by
unknown
15:13 queued 07:44
created

DummyField   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 38
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldSkip() 0 4 1
A getListView() 0 7 1
A getEditFormView() 0 9 2
A getCreateFormView() 0 6 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Markup;
4
5
use Illuminate\Http\Request;
6
use Yaro\Jarboe\Table\Fields\AbstractField;
7
8
class DummyField extends AbstractField
9
{
10
    protected $hidden = [
11
        'list'   => true,
12
        'edit'   => false,
13
        'create' => false,
14
    ];
15
16 1
    public function shouldSkip(Request $request)
17
    {
18 1
        return true;
19
    }
20
21 1
    public function getListView($model)
22
    {
23 1
        return view('jarboe::crud.fields.markup.dummy.list', [
24 1
            'model' => $model,
25 1
            'field' => $this,
26
        ]);
27
    }
28
29 1
    public function getEditFormView($model)
30
    {
31 1
        $template = $this->isReadonly() ? 'readonly' : 'edit';
32
33 1
        return view('jarboe::crud.fields.markup.dummy.'. $template, [
34 1
            'model' => $model,
35 1
            'field' => $this,
36
        ]);
37
    }
38
39 1
    public function getCreateFormView()
40
    {
41 1
        return view('jarboe::crud.fields.markup.dummy.create', [
42 1
            'field' => $this,
43
        ]);
44
    }
45
}
46