Completed
Pull Request — master (#34)
by Daniel
02:15
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\Metadata\SourceMetadata;
8
use Psi\Component\Grid\Metadata\ViewMetadata;
9
10
final class ColumnMetadata
11
{
12
    private $name;
13
    private $type;
14
    private $options = [];
15
16
    public function __construct(
17
        string $name,
0 ignored issues
show
Unused Code introduced by
The parameter $name 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...
18
        SourceMetadata $source,
19
        ViewMetadata $view
20
    ) {
21
        $this->source = $source;
0 ignored issues
show
Bug introduced by
The property source 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...
22
        $this->view = $view;
0 ignored issues
show
Bug introduced by
The property view 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...
23
    }
24
25
    public function getName(): string
26
    {
27
        return $this->name;
28
    }
29
30
    public function getSource(): SourceMetadata
31
    {
32
        return $this->source;
33
    }
34
35
    public function getView(): ViewMetadata
36
    {
37
        return $this->view;
38
    }
39
}
40