Completed
Push — feature/fixing_cost ( befe8a...8cb2e1 )
by Laurent
02:18
created

TotalDamage::isInvoiced()   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 $amount;
16
17
    /**
18
     * @var int
19
     */
20
    private $authorId;
21
22
    /**
23
     * @var string
24
     */
25
    private $authorName;
26
27
    /**
28
     * @var bool
29
     */
30
    private $invoiced;
31
32
    /**
33
     * @param float $amount
34
     * @param int $authorId
35
     * @param string $authorName
36
     * @param bool $invoiced
37
     */
38
    public function __construct($amount, $authorId, $authorName, $invoiced)
39
    {
40
        $this->amount = $amount;
41
        $this->authorId = $authorId;
42
        $this->authorName = $authorName;
43
        $this->invoiced = $invoiced;
44
    }
45
46
    /**
47
     * @param array $values
48
     *
49
     * @return mixed
50
     */
51
    public static function fromArray(array $values)
52
    {
53
        return new self($values['amount'], $values['author'], $values['author_name'], $values['billed']);
54
    }
55
56
    /**
57
     * @return float
58
     */
59
    public function getAmount()
60
    {
61
        return $this->amount;
62
    }
63
64
    /**
65
     * @return int
66
     */
67
    public function getAuthorId()
68
    {
69
        return $this->authorId;
70
    }
71
72
    /**
73
     * @return bool
74
     */
75
    public function isInvoiced()
76
    {
77
        return $this->invoiced;
78
    }
79
80
    /**
81
     * @return string
82
     */
83
    public function getAuthorName()
84
    {
85
        return $this->authorName;
86
    }
87
88
}