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

TotalDamage::getTotalAmount()   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
use FlightLog\Application\Common\ViewModel\ViewModel;
8
9
final class TotalDamage extends ViewModel
10
{
11
12
    /**
13
     * @var float
14
     */
15
    private $totalAmount;
16
17
    /**
18
     * @var int
19
     */
20
    private $authorId;
21
22
    /**
23
     * @param float $totalAmount
24
     * @param int $authorId
25
     */
26
    public function __construct($totalAmount, $authorId)
27
    {
28
        $this->totalAmount = $totalAmount;
29
        $this->authorId = $authorId;
30
    }
31
32
    /**
33
     * @param array $values
34
     *
35
     * @return mixed
36
     */
37
    public static function fromArray(array $values)
38
    {
39
        return new self($values['total_amount'], $values['author']);
40
    }
41
42
    /**
43
     * @return float
44
     */
45
    public function getTotalAmount()
46
    {
47
        return $this->totalAmount;
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function getAuthorId()
54
    {
55
        return $this->authorId;
56
    }
57
58
59
}