Passed
Push — master ( 213731...919d61 )
by Thomas
01:51
created

CrudAbstract   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A make() 0 4 1
A label() 0 6 1
A prefix() 0 6 1
A suffix() 0 6 1
1
<?php
2
3
namespace Webfactor\Laravel\Backpack\FluentSyntax\Contracts;
4
5
class CrudAbstract implements CrudInterface
6
{
7
    protected $options = [];
8
9
    protected $type = 'text';
10
11
    public function __construct(string $name)
12
    {
13
        $this->options['name'] = $name;
14
        $this->options['type'] = $this->type;
15
    }
16
17
    public function make(): array
18
    {
19
        return $this->options;
20
    }
21
22
    /*
23
    |--------------------------------------------------------------------------
24
    | Methods available for all Field and Column Types
25
    |--------------------------------------------------------------------------
26
    */
27
28
    public function label(string $label)
29
    {
30
        $this->options['label'] = $label;
31
32
        return $this;
33
    }
34
35
    public function prefix(string $prefix)
36
    {
37
        $this->options['prefix'] = $prefix;
38
39
        return $this;
40
    }
41
42
    public function suffix(string $suffix)
43
    {
44
        $this->options['suffix'] = $suffix;
45
46
        return $this;
47
    }
48
}
49