Completed
Push — master ( 621fe7...1b6290 )
by Luke
02:31
created

MinimumContractLengthObject::getUnits()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ZpgRtf\Objects;
4
5
/**
6
 * The rental_term attribute can be specified with a minimum_contract_length object or, if the contract length is not
7
 * currently known, by an enum that roughly indicates its likely duration (e.g. "short_term").
8
 */
9
class MinimumContractLengthObject implements \JsonSerializable
10
{
11
    /** @var float */
12
    private $minimumLength;
13
14
    /**
15
     * Enum (days, weeks, months, years)
16
     *
17
     * @var string
18
     */
19
    private $units;
20
21
    /**
22
     * @return float
23
     */
24 2
    public function getMinimumLength()
25
    {
26 2
        return $this->minimumLength;
27
    }
28
29
    /**
30
     * @param float $minimumLength
31
     *
32
     * @return MinimumContractLengthObject
33
     */
34 1
    public function setMinimumLength($minimumLength)
35
    {
36 1
        $this->minimumLength = $minimumLength;
37
38 1
        return $this;
39
    }
40
41
    /**
42
     * @return string
43
     */
44 2
    public function getUnits()
45
    {
46 2
        return $this->units;
47
    }
48
49
    /**
50
     * @param string $units
51
     *
52
     * @return MinimumContractLengthObject
53
     */
54 1
    public function setUnits($units)
55
    {
56 1
        $this->units = $units;
57
58 1
        return $this;
59
    }
60
61
    /** {@inheritDoc} */
62 1
    public function jsonSerialize()
63
    {
64
        return [
65 1
            'minimum_length' => $this->getMinimumLength(),
66 1
            'units' => $this->getUnits(),
67
        ];
68
    }
69
}
70