1 | <?php |
||
6 | final class FlightDamage |
||
7 | { |
||
8 | /** |
||
9 | * @var DamageId|null |
||
10 | */ |
||
11 | private $id; |
||
12 | |||
13 | /** |
||
14 | * @var FlightId |
||
15 | */ |
||
16 | private $flight; |
||
17 | |||
18 | /** |
||
19 | * @var DamageAmount |
||
20 | */ |
||
21 | private $amount; |
||
22 | |||
23 | /** |
||
24 | * @var bool |
||
25 | */ |
||
26 | private $billed; |
||
27 | |||
28 | /** |
||
29 | * @var AuthorId |
||
30 | */ |
||
31 | private $author; |
||
32 | |||
33 | /** |
||
34 | * @param FlightId $flightId |
||
35 | * @param DamageAmount $amount |
||
36 | * @param $billed |
||
37 | * @param AuthorId $authorId |
||
38 | * @param DamageId|null $id |
||
39 | */ |
||
40 | private function __construct(DamageAmount $amount, $billed, AuthorId $authorId, FlightId $flightId = null, DamageId $id = null) |
||
48 | |||
49 | /** |
||
50 | * @param FlightId $flightId |
||
51 | * @param DamageAmount $amount |
||
52 | * @param $billed |
||
53 | * @param AuthorId $authorId |
||
54 | * @param DamageId|null $id |
||
55 | * |
||
56 | * @return FlightDamage |
||
57 | */ |
||
58 | public static function load(FlightId $flightId, DamageAmount $amount, $billed, AuthorId $authorId, DamageId $id = null){ |
||
61 | |||
62 | /** |
||
63 | * @param FlightId $flightId |
||
64 | * @param DamageAmount $amount |
||
65 | * @param AuthorId $authorId |
||
66 | * |
||
67 | * @return FlightDamage |
||
68 | */ |
||
69 | public static function damage(FlightId $flightId, DamageAmount $amount, AuthorId $authorId){ |
||
72 | |||
73 | /** |
||
74 | * @param DamageAmount $amount |
||
75 | * @param AuthorId $authorId |
||
76 | * |
||
77 | * @return FlightDamage |
||
78 | */ |
||
79 | public static function waiting(DamageAmount $amount, AuthorId $authorId){ |
||
82 | |||
83 | /** |
||
84 | * @return bool |
||
85 | */ |
||
86 | public function isBilled() |
||
90 | |||
91 | /** |
||
92 | * @return FlightId |
||
93 | */ |
||
94 | public function getFlightId(){ |
||
97 | |||
98 | /** |
||
99 | * @return DamageAmount |
||
100 | */ |
||
101 | public function amount(){ |
||
104 | |||
105 | /** |
||
106 | * @return AuthorId |
||
107 | */ |
||
108 | public function getAuthor() |
||
112 | |||
113 | /** |
||
114 | * Invoice the damage. |
||
115 | * |
||
116 | * @return FlightDamage |
||
117 | */ |
||
118 | public function invoice(){ |
||
121 | |||
122 | /** |
||
123 | * @return DamageId|null |
||
124 | */ |
||
125 | public function getId() |
||
129 | |||
130 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: