Issues (188)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

command/CreateFlightBillCommand.php (1 issue)

Upgrade to new PHP Analysis Engine

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
Documentation Bug introduced by
It seems like $nbrPax can also be of type double or string. However, the property $nbrPax is declared as type integer. Maybe add an additional type check?

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 the id property of an instance of the Account 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.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
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
}