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

Attribute::isEmpty()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 3
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