FlightPoints::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 *
4
 */
5
6
/**
7
 * Number of points
8
 *
9
 * @author Laurent De Coninck <[email protected]>
10
 */
11
class FlightPoints
12
{
13
14
    /**
15
     * @var int
16
     */
17
    private $amount;
18
19
    /**
20
     * @param int $amount
21
     */
22
    private function __construct($amount)
23
    {
24
        $this->amount = $amount;
25
    }
26
27
    /**
28
     * @param int $initialAmount
29
     *
30
     * @return FlightPoints
31
     */
32
    public static function create($initialAmount)
33
    {
34
        return new FlightPoints($initialAmount);
35
    }
36
37
    /**
38
     * @param int $factor
39
     *
40
     * @return FlightPoints
41
     */
42
    public function multiply($factor)
43
    {
44
        return new FlightPoints($this->amount * $factor);
45
    }
46
47
    /**
48
     * @return int
49
     */
50
    public function getValue()
51
    {
52
        return $this->amount;
53
    }
54
55
}