Completed
Push — master ( 25f8d8...b9ecd3 )
by tac
02:20
created

Field   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 6
Bugs 1 Features 0
Metric Value
wmc 5
c 6
b 1
f 0
lcom 1
cbo 3
dl 0
loc 33
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A name() 0 5 1
A value() 0 5 1
A errors() 0 5 1
A rules() 0 5 1
1
<?php
2
3
namespace Tacone\Bees\Field;
4
5
use Tacone\Bees\Attribute\ArrAttribute;
6
use Tacone\Bees\Attribute\JoinedArrayAttribute;
7
use Tacone\Bees\Attribute\ScalarAttribute;
8
9
abstract class Field
10
{
11
    protected $data = [];
12
13
    public function __construct($name, $label = null)
0 ignored issues
show
Unused Code introduced by
The parameter $label is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        $this->name($name);
16
    }
17
18
    public function name($value = null)
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        return ScalarAttribute::make($this, $this->data, 'name')
21
            ->handle(func_get_args());
22
    }
23
24
    public function value($value = null)
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        return ScalarAttribute::make($this, $this->data, 'value')
27
            ->handle(func_get_args());
28
    }
29
30
    public function errors($value = null)
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        return ArrAttribute::make($this, $this->data, 'errors')
33
            ->handle(func_get_args());
34
    }
35
36
    public function rules($value = null)
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
37
    {
38
        return JoinedArrayAttribute::make($this, $this->data, 'rules')
39
            ->handle(func_get_args());
40
    }
41
}
42