Passed
Push — main ( 5926a8...a239d4 )
by Garbuz
03:10
created

TextField   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 24
ccs 8
cts 8
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A init() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace GarbuzIvan\LaravelGeneratorPackage\Form\Fields;
6
7
use Closure;
8
use Exception;
9
use GarbuzIvan\LaravelGeneratorPackage\Configuration;
10
use GarbuzIvan\LaravelGeneratorPackage\Contracts\FieldInterface;
11
use Illuminate\Support\Facades\App;
12
13
class TextField extends FieldAbstract
14
{
15
    protected Configuration $config;
16
17
    /**
18
     * constructor.
19
     * @param Configuration $config
20
     */
21 15
    public function __construct(Configuration $config)
22
    {
23 15
        $this->config = $config;
24 15
    }
25
26
    /**
27
     * TextField init.
28
     * @param array $arguments
29
     * @throws Exception
30
     */
31 15
    public function init(array $arguments): FieldInterface
32
    {
33 15
        parent::init($arguments);
34 13
        $this->setType('string');
35 13
        $this->setLight(255);
36 13
        return $this;
37
    }
38
}
39