Completed
Push — feature/fixing_cost ( ef981e )
by Laurent
01:53
created

Damage::getAuthorName()   A

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
namespace FlightLog\Application\Damage\ViewModel;
5
6
7
final class Damage
8
{
9
10
    /**
11
     * @var string
12
     */
13
    private $authorName;
14
15
    /**
16
     * @var float
17
     */
18
    private $amount;
19
20
    /**
21
     * @param string $authorName
22
     * @param float $amount
23
     */
24
    public function __construct($authorName, $amount)
25
    {
26
        $this->authorName = $authorName;
27
        $this->amount = $amount;
28
    }
29
30
    /**
31
     * @param array $properties
32
     *
33
     * @return Damage
34
     */
35
    public static function fromArray(array $properties){
36
        $author = $properties['author_name'];
37
        $amount = $properties['amount'];
38
39
        return new self($author, $amount);
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getAuthorName()
46
    {
47
        return $this->authorName;
48
    }
49
50
    /**
51
     * @return float
52
     */
53
    public function getAmount()
54
    {
55
        return $this->amount;
56
    }
57
}