This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * |
||
4 | */ |
||
5 | |||
6 | /** |
||
7 | * @author Laurent De Coninck <[email protected]> |
||
8 | */ |
||
9 | class CreateFlightBillCommand |
||
10 | { |
||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | private $flightId; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $billingType; |
||
20 | |||
21 | /** |
||
22 | * @var int |
||
23 | */ |
||
24 | private $billType; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | private $billingCondition; |
||
30 | |||
31 | /** |
||
32 | * @var int |
||
33 | */ |
||
34 | private $modelDocument; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | private $publicNote; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private $privateNote; |
||
45 | |||
46 | /** |
||
47 | * @var int |
||
48 | */ |
||
49 | private $bankAccount; |
||
50 | |||
51 | /** |
||
52 | * @var int |
||
53 | */ |
||
54 | private $nbrPax; |
||
55 | |||
56 | /** |
||
57 | * @param int $flightId |
||
58 | * @param int $billingType |
||
59 | * @param int $billingCondition |
||
60 | * @param int $modelDocument |
||
61 | * @param int $billType |
||
62 | * @param string $publicNote |
||
63 | * @param string $privateNote |
||
64 | * @param int $bankAccount |
||
65 | * @param int $nbrPax |
||
66 | */ |
||
67 | public function __construct( |
||
68 | $flightId, |
||
69 | $billingType, |
||
70 | $billingCondition, |
||
71 | $modelDocument, |
||
72 | $billType, |
||
73 | $publicNote, |
||
74 | $privateNote, |
||
75 | $bankAccount, |
||
76 | $nbrPax |
||
77 | ) { |
||
78 | if (empty($flightId)) { |
||
79 | throw new \InvalidArgumentException('Flight id is missing'); |
||
80 | } |
||
81 | |||
82 | if (empty($billingType)) { |
||
83 | throw new \InvalidArgumentException('Billing type is missing'); |
||
84 | } |
||
85 | |||
86 | if (empty($billingCondition)) { |
||
87 | throw new \InvalidArgumentException('Billing condition is missing'); |
||
88 | } |
||
89 | |||
90 | if (empty($modelDocument)) { |
||
91 | throw new \InvalidArgumentException('Model document is missing'); |
||
92 | } |
||
93 | |||
94 | if(!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax){ |
||
95 | throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected'); |
||
96 | } |
||
97 | |||
98 | $this->flightId = $flightId; |
||
99 | $this->billingType = $billingType; |
||
100 | $this->billingCondition = $billingCondition; |
||
101 | $this->modelDocument = $modelDocument; |
||
102 | $this->billType = $billType; |
||
103 | $this->publicNote = $publicNote; |
||
104 | $this->privateNote = $privateNote; |
||
105 | $this->bankAccount = $bankAccount; |
||
106 | $this->nbrPax = $nbrPax; |
||
0 ignored issues
–
show
|
|||
107 | } |
||
108 | |||
109 | /** |
||
110 | * @return int |
||
111 | */ |
||
112 | public function getFlightId() |
||
113 | { |
||
114 | return $this->flightId; |
||
115 | } |
||
116 | |||
117 | /** |
||
118 | * @return int |
||
119 | */ |
||
120 | public function getBillingType() |
||
121 | { |
||
122 | return $this->billingType; |
||
123 | } |
||
124 | |||
125 | /** |
||
126 | * @return int |
||
127 | */ |
||
128 | public function getBillingCondition() |
||
129 | { |
||
130 | return $this->billingCondition; |
||
131 | } |
||
132 | |||
133 | /** |
||
134 | * @return int |
||
135 | */ |
||
136 | public function getModelDocument() |
||
137 | { |
||
138 | return $this->modelDocument; |
||
139 | } |
||
140 | |||
141 | /** |
||
142 | * @return int |
||
143 | */ |
||
144 | public function getBillType() |
||
145 | { |
||
146 | return $this->billType; |
||
147 | } |
||
148 | |||
149 | /** |
||
150 | * @return string |
||
151 | */ |
||
152 | public function getPublicNote() |
||
153 | { |
||
154 | return $this->publicNote; |
||
155 | } |
||
156 | |||
157 | /** |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getPrivateNote() |
||
161 | { |
||
162 | return $this->privateNote; |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * @return int |
||
167 | */ |
||
168 | public function getBankAccount() |
||
169 | { |
||
170 | return $this->bankAccount; |
||
171 | } |
||
172 | |||
173 | /** |
||
174 | * @return int |
||
175 | */ |
||
176 | public function getNbrPax() |
||
177 | { |
||
178 | return $this->nbrPax; |
||
179 | } |
||
180 | |||
181 | } |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.