Property   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 46
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getKey() 0 4 1
A setValue() 0 4 1
A getValue() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Mediapart Selligent Client API
5
 *
6
 * CC BY-NC-SA <https://github.com/mediapart/selligent>
7
 *
8
 * For the full license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Mediapart\Selligent;
13
14
/**
15
 * Combination of a key and a value.
16
 * The key is a field name and the value is a formatted string.
17
 */
18
class Property
19
{
20
    /**
21
     * @var string
22
     */
23
    protected $Key;
24
25
    /**
26
     * @var mixed
27
     */
28
    protected $Value;
29
30
    /**
31
     * @param string $key
32
     * @param mixed $value
33
     */
34 7
    public function __construct($key, $value = null)
35
    {
36 7
        $this->Key = $key;
37 7
        $this->setValue($value);
38 7
    }
39
40
    /**
41
     * @return string
42
     */
43 7
    public function getKey()
44
    {
45 7
        return $this->Key;
46
    }
47
48
    /**
49
     * @return bool
50
     */
51 7
    public function setValue($value)
52
    {
53 7
        return $this->Value = $value;
54
    }
55
56
    /**
57
     * @return mixed
58
     */
59 6
    public function getValue()
60
    {
61 6
        return $this->Value;
62
    }
63
}
64