Completed
Push — master ( bc462e...3c2183 )
by Daniel
07:13
created

ColumnMetadata::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Psi\Component\Grid\Metadata;
6
7
use Psi\Component\Grid\Grid;
8
9
final class ColumnMetadata
10
{
11
    private $name;
12
    private $type;
13
    private $groups = [];
14
    private $options = [];
15
16
    public function __construct(
17
        string $name,
18
        string $type,
19
        array $groups,
20
        array $options,
21
        array $tags
22
    ) {
23
        $this->name = $name;
24
        $this->type = $type;
25
        $this->groups = $groups ?: [ Grid::DEFAULT_GROUP ];
26
        $this->options = $options;
27
        $this->tags = $tags;
0 ignored issues
show
Bug introduced by
The property tags does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
28
    }
29
30
    public function getName(): string
31
    {
32
        return $this->name;
33
    }
34
35
    public function getType(): string
36
    {
37
        return $this->type;
38
    }
39
40
    public function getOptions(): array
41
    {
42
        return $this->options;
43
    }
44
45
    public function getTags(): array
46
    {
47
        return $this->tags;
48
    }
49
50
    public function getGroups(): array
51
    {
52
        return $this->groups;
53
    }
54
}
55