FieldsetMarkup   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Test Coverage

Coverage 96.55%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 25
c 1
b 0
f 0
dl 0
loc 71
ccs 28
cts 29
cp 0.9655
rs 10
wmc 11

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getListView() 0 3 1
A getEditFormView() 0 6 1
A fields() 0 5 1
A shouldSkip() 0 3 1
A getLegend() 0 3 1
A getCreateFormView() 0 5 1
A getFields() 0 3 1
A legend() 0 5 1
A isMarkupRow() 0 3 1
A prepare() 0 4 2
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;
0 ignored issues
show
Bug introduced by
The type Yaro\Jarboe\Table\Fields\AbstractField was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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