Field   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

6 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
cast() 0 1 ?
1
<?php
2
3
namespace Tacone\Bees\Field;
4
5
use Tacone\Bees\Attribute\ArrayAttribute;
6
use Tacone\Bees\Attribute\JoinedArrayAttribute;
7
use Tacone\Bees\Attribute\Attribute;
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 Attribute::make($this, $this->data, __FUNCTION__)
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 Attribute::make($this, $this->data, __FUNCTION__)
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 ArrayAttribute::make($this, $this->data, __FUNCTION__)
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, __FUNCTION__)
39
            ->handle(func_get_args());
40
    }
41
42
    abstract public function cast();
43
}
44