Completed
Push — master ( 5f70f9...b43387 )
by Yaro
04:12
created

FieldsetMarkup   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 96.55%

Importance

Changes 0
Metric Value
wmc 11
lcom 2
cbo 1
dl 0
loc 74
ccs 28
cts 29
cp 0.9655
rs 10
c 0
b 0
f 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A fields() 0 6 1
A legend() 0 6 1
A getLegend() 0 4 1
A getFields() 0 4 1
A shouldSkip() 0 4 1
A isMarkupRow() 0 4 1
A prepare() 0 6 2
A getListView() 0 4 1
A getEditFormView() 0 8 1
A getCreateFormView() 0 7 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Fields\Markup;
4
5
use Illuminate\Http\Request;
6
use Yaro\Jarboe\Table\CRUD;
7
use Yaro\Jarboe\Table\Fields\AbstractField;
8
9
class FieldsetMarkup extends AbstractField
10
{
11
    protected $legend = '';
12
    protected $fields = [];
13
14 2
    public function fields(array $fields)
15
    {
16 2
        $this->fields = $fields;
17
18 2
        return $this;
19
    }
20
21 1
    public function legend(string $legend)
22
    {
23 1
        $this->legend = $legend;
24
25 1
        return $this;
26
    }
27
28 1
    public function getLegend(): string
29
    {
30 1
        return $this->legend;
31
    }
32
33 1
    public function getFields(): array
34
    {
35 1
        return $this->fields;
36
    }
37
38
    protected $hidden = [
39
        'list'   => true,
40
        'edit'   => false,
41
        'create' => false,
42
    ];
43
44 1
    public function shouldSkip(Request $request)
45
    {
46 1
        return true;
47
    }
48
49 1
    public function isMarkupRow()
50
    {
51 1
        return true;
52
    }
53
54 1
    public function prepare(CRUD $crud)
55
    {
56 1
        foreach ($this->fields as $field) {
57 1
            $field->prepare($crud);
58
        }
59
    }
60
61 1
    public function getListView($model)
62
    {
63 1
        return '';
64
    }
65
66 1
    public function getEditFormView($model)
67
    {
68 1
        return view('jarboe::crud.fields.markup.fieldset.edit', [
69 1
            'model' => $model,
70 1
            'field' => $this,
71 1
            'rowsLeft' => 12,
72
        ]);
73
    }
74
75 1
    public function getCreateFormView()
76
    {
77 1
        return view('jarboe::crud.fields.markup.fieldset.create', [
78 1
            'field' => $this,
79 1
            'rowsLeft' => 12,
80
        ]);
81
    }
82
}
83