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

Attribute   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isEmpty() 0 3 2
A getValue() 0 3 1
A getName() 0 3 1
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