Completed
Push — master ( a97ce7...6f972b )
by Jan
03:17
created

Attribute::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Kontrolio\Data;
4
5
final class Attribute
6
{
7
    private $value;
8
    private $attribute;
9
10
    /**
11
     * @param string $attribute
12
     * @param mixed $value
13
     */
14
    public function __construct($attribute, $value = null)
15
    {
16
        $this->attribute = $attribute;
17
        $this->value = $value;
18
    }
19
20
    public function getName()
21
    {
22
        return $this->attribute;
23
    }
24
25
    public function getValue()
26
    {
27
        return $this->value;
28
    }
29
30
    public function isEmpty()
31
    {
32
        return $this->value === null || $this->value === '';
33
    }
34
}
35