FlightPoints   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 4 1
A multiply() 0 4 1
A getValue() 0 4 1
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
}