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

Field::errors()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4286
nc 1
cc 1
eloc 3
nop 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