Fields   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A add() 0 4 1
A get() 0 4 1
1
<?php
2
3
/**
4
 * Author: Nil Portugués Calderó <[email protected]>
5
 * Date: 9/01/16
6
 * Time: 15:30.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace NilPortugues\Foundation\Domain\Model\Repository;
12
13
use NilPortugues\Foundation\Domain\Model\Repository\Contracts\Fields as FieldsInterface;
14
15
/**
16
 * Class Fields.
17
 */
18
class Fields implements FieldsInterface
19
{
20
    /**
21
     * @var array
22
     */
23
    private $fields = [];
24
25
    /**
26
     * Fields constructor.
27
     *
28
     * @param array $fields
29
     */
30
    public function __construct(array $fields = [])
31
    {
32
        $this->fields = $fields;
33
    }
34
35
    /**
36
     * @param string $field
37
     */
38
    public function add($field)
39
    {
40
        $this->fields[] = (string) $field;
41
    }
42
43
    /**
44
     * @return array
45
     */
46
    public function get()
47
    {
48
        return (array) $this->fields;
49
    }
50
}
51