Issues (43)

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/SimpleUPS/Rates/ShippingMethod.php (1 issue)

Labels
Severity

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 namespace SimpleUPS\Rates;
2
3
use \SimpleUPS\Service;
4
5
/**
6
 * A shipping method is a shipping service associated with a price
7
 * @since 1.0
8
 */
9
class ShippingMethod extends \SimpleUPS\Model
10
{
11
    private
12
        /* @var \SimpleUPS\Service $service */
13
        $service,
14
        /* @var integer|null $guaranteedDaysToDelivery */
15
        $guaranteedDaysToDelivery,
16
17
        /* @var float $transportationCharges */
18
        $transportationCharges,
19
        /* @var float $serviceOptionsCharges */
20
        $serviceOptionsCharges,
21
22
        /* @var float $totalCharges */
23
        $totalCharges,
24
        /* @var DateTime|null $scheduledDeliveryTime */
25
        $scheduledDeliveryTime,
26
27
        /* @var string[]|null $warnings */
28
        $warnings;
29
30
    /**
31
     * @internal
32
     *
33
     * @param integer $guaranteedDaysToDelivery
34
     *
35
     * @return ShippingMethod
36
     */
37
    public function setGuaranteedDaysToDelivery($guaranteedDaysToDelivery)
38
    {
39
        $this->guaranteedDaysToDelivery = $guaranteedDaysToDelivery;
40
        return $this;
41
    }
42
43
    /**
44
     * @return integer
45
     */
46
    public function getGuaranteedDaysToDelivery()
47
    {
48
        return $this->guaranteedDaysToDelivery;
49
    }
50
51
    /**
52
     * @internal
53
     *
54
     * @param \DateTime $scheduledDeliveryTime
55
     *
56
     * @return ShippingMethod
57
     */
58
    public function setScheduledDeliveryTime(\DateTime $scheduledDeliveryTime)
59
    {
60
        $this->scheduledDeliveryTime = $scheduledDeliveryTime;
61
        return $this;
62
    }
63
64
    /**
65
     * @return \DateTime
66
     */
67
    public function getScheduledDeliveryTime()
68
    {
69
        return $this->scheduledDeliveryTime;
70
    }
71
72
    /**
73
     * @internal
74
     *
75
     * @param \SimpleUPS\Service $service
76
     *
77
     * @return ShippingMethod
78
     */
79
    public function setService(\SimpleUPS\Service $service)
80
    {
81
        $this->service = $service;
82
        return $this;
83
    }
84
85
    /**
86
     * @return \SimpleUPS\Service
87
     */
88
    public function getService()
89
    {
90
        return $this->service;
91
    }
92
93
    /**
94
     * @internal
95
     *
96
     * @param float $serviceOptionsCharges
97
     *
98
     * @return ShippingMethod
99
     */
100
    public function setServiceOptionsCharges($serviceOptionsCharges)
101
    {
102
        $this->serviceOptionsCharges = (float)$serviceOptionsCharges;
103
        return $this;
104
    }
105
106
    /**
107
     * @return float
108
     */
109
    public function getServiceOptionsCharges()
110
    {
111
        return $this->serviceOptionsCharges;
112
    }
113
114
    /**
115
     * @internal
116
     *
117
     * @param float $transportationCharges
118
     *
119
     * @return ShippingMethod
120
     */
121
    public function setTransportationCharges($transportationCharges)
122
    {
123
        $this->transportationCharges = (float)$transportationCharges;
124
        return $this;
125
    }
126
127
    /**
128
     * @return float
129
     */
130
    public function getTransportationCharges()
131
    {
132
        return $this->transportationCharges;
133
    }
134
135
    /**
136
     * @internal
137
     *
138
     * @param float $totalCharges
139
     *
140
     * @return ShippingMethod
141
     */
142
    public function setTotalCharges($totalCharges)
143
    {
144
        $this->totalCharges = (float)$totalCharges;
145
        return $this;
146
    }
147
148
    /**
149
     * @return float
150
     */
151
    public function getTotalCharges()
152
    {
153
        return $this->totalCharges;
154
    }
155
156
    /**
157
     * @internal
158
     *
159
     * @param string $totalCharges
0 ignored issues
show
There is no parameter named $totalCharges. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
160
     *
161
     * @return ShippingMethod
162
     */
163
    public function addWarning($warning)
164
    {
165
        if ($this->warnings === null) {
166
            $this->warnings = array();
167
        }
168
169
        $this->warnings[] = $warning;
170
        return $this;
171
    }
172
173
    /**
174
     * Determine if UPS provided any warnings for this shipment
175
     * @see ShippingMethod::getWarnings()
176
     * @return bool
177
     */
178
    public function hasWarnings()
179
    {
180
        return $this->warnings == null;
181
    }
182
183
    /**
184
     * Get warnings associated with this shipping method
185
     * @see ShippingMethod::hasWarnings()
186
     * @return string[]
187
     */
188
    public function getWarnings()
189
    {
190
        return $this->warnings;
191
    }
192
193
    /**
194
     * @internal
195
     *
196
     * @param \SimpleXMLElement $xml
197
     *
198
     * @return ShippingMethod
199
     */
200
    public static function fromXml(\SimpleXMLElement $xml)
201
    {
202
        $shippingMethod = new ShippingMethod();
203
        $shippingMethod->setIsResponse();
204
        $shippingMethod->setService(Service::fromXml($xml->Service));
205
206
        if (isset($xml->TotalCharges->MonetaryValue)) {
207
            $shippingMethod->setTotalCharges($xml->TotalCharges->MonetaryValue);
208
        }
209
210
        if (isset($xml->TransportationCharges->MonetaryValue)) {
211
            $shippingMethod->setTransportationCharges($xml->TransportationCharges->MonetaryValue);
212
        }
213
214
        if (isset($xml->ServiceOptionsCharges->MonetaryValue)) {
215
            $shippingMethod->setServiceOptionsCharges($xml->ServiceOptionsCharges->MonetaryValue);
216
        }
217
218
        if (isset($xml->GuaranteedDaysToDelivery) && is_numeric($xml->GuaranteedDaysToDelivery)) {
219
            $shippingMethod->setGuaranteedDaysToDelivery($xml->GuaranteedDaysToDelivery);
220
        }
221
222
        if (isset($xml->ScheduledDeliveryTime)) {
223
            $shippingMethod->setScheduledDeliveryTime(new \DateTime($xml->ScheduledDeliveryTime));
224
        }
225
226
        return $shippingMethod;
227
    }
228
}