Issues (149)

Security Analysis    no request data  

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.

src/Api/DataTransfer/SessionParameters.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
 * @author Jean Silva <[email protected]>
4
 * @license MIT
5
 */
6
namespace Jeancsil\FlightSpy\Api\DataTransfer;
7
8
/**
9
 * @see http://business.skyscanner.net/portal/en-GB/Documentation/FlightsLivePricingList#createsession
10
 *
11
 * [name] [mandatory?] [description]
12
 * apiKey    Yes    The API Key to identify the customer    String    Must be a valid API Key
13
 * country    Yes    The user’s market country    String    ISO country code, or specified location schema
14
 * currency    Yes    The user’s currency    String    ISO currency code
15
 * locale    Yes    The user’s localization preference    String    ISO locale code (language and country)
16
 * originplace    Yes    The origin city or airport    String    Specified location schema, or Skyscanner Rnid
17
 * destinationplace    Yes    The destination city or airport    String    Specified location schema, or Skyscanner Rnid
18
 * outbounddate    Yes    The departure date    Date    Formatted as YYYY-mm-dd
19
 * inbounddate    No    The return date    Date    Formatted as YYYY-mm-dd
20
 * locationschema    No    The code schema used for locations    String    The supported codes are below
21
 * cabinclass    No    The Cabin Class    String    The supported codes are below
22
 * adults    Yes    The number of adults    Int    Defaults to 1 if not specified. Maximum 8
23
 * children    No    The number of children    Int    Defaults to 0, maximum 8
24
 * infants    No    The number of infants    Int    Defaults to 0, cannot exceed adults
25
 */
26
class SessionParameters
27
{
28
    /**
29
     * @var string
30
     */
31
    public $apiKey;
32
33
    /**
34
     * @var string
35
     */
36
    public $country;
37
38
    /**
39
     * @var string
40
     */
41
    public $currency;
42
43
    /**
44
     * @var string
45
     */
46
    public $locale;
47
48
    /**
49
     * @var string
50
     */
51
    public $originPlace;
52
53
    /**
54
     * @var string
55
     */
56
    public $destinationPlace;
57
58
    /**
59
     * @var string
60
     */
61
    public $outboundDate;
62
63
    /**
64
     * @var integer
65
     */
66
    public $adults;
67
68
    /**
69
     * @var string
70
     */
71
    public $inboundDate;
72
73
    /**
74
     * @var string
75
     */
76
    public $locationSchema;
77
78
    /**
79
     * @var string
80
     */
81
    public $cabinClass;
82
83
    /**
84
     * @var integer
85
     */
86
    public $children;
87
88
    /**
89
     * @var integer
90
     */
91
    public $infants;
92
93
    /**
94
     * @var float
95
     */
96
    private $maxPrice;
97
98
    /**
99
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use array<string,string|integer>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
100
     */
101
    public function toArray()
102
    {
103
        $params = [
104
            'apiKey' => $this->apiKey,
105
            'country' => $this->country,
106
            'currency' => $this->currency,
107
            'locale' => $this->locale,
108
            'originplace' => $this->originPlace,
109
            'destinationplace' => $this->destinationPlace,
110
            'outbounddate' => $this->outboundDate,
111
            'adults' => $this->adults
112
        ];
113
114
        if ($this->inboundDate) {
115
            $params['inbounddate'] = $this->inboundDate;
116
        }
117
118
        if ($this->locationSchema) {
119
            $params['locationschema'] = $this->locationSchema;
120
        }
121
122
        if ($this->cabinClass) {
123
            $params['cabinclass'] = $this->cabinClass;
124
        }
125
126
        if ($this->infants) {
127
            $params['infants'] = $this->infants;
128
        }
129
130
        if ($this->children) {
131
            $params['children'] = $this->children;
132
        }
133
134
        return $params;
135
    }
136
137
    /**
138
     * @return float
139
     */
140
    public function getMaxPrice()
141
    {
142
        return $this->maxPrice;
143
    }
144
145
    /**
146
     * @param float $maxPrice
147
     */
148
    public function setMaxPrice($maxPrice)
149
    {
150
        $this->maxPrice = (float) $maxPrice;
151
    }
152
153
    /**
154
     * @return string
155
     */
156
    public function __toString()
157
    {
158
        return sprintf(
159
            '%s <-> %s out %s in %s %s %s. Adults/Kids/Infants: %d/%d/%d',
160
            $this->originPlace,
161
            $this->destinationPlace,
162
            (new \DateTime($this->outboundDate))->format('d.m.Y'),
163
            (new \DateTime($this->inboundDate))->format('d.m.Y'),
164
            $this->currency,
165
            $this->maxPrice,
166
            $this->adults,
167
            $this->children,
168
            $this->infants
169
        );
170
    }
171
}
172