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

CrudAbstract::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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