Issues (21)

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/Received/Partial/Detail.php (2 issues)

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
namespace MrPrompt\Centercob\Received\Partial;
3
4
use MrPrompt\ShipmentCommon\Base\Client;
5
use MrPrompt\ShipmentCommon\Base\Parcel;
6
use MrPrompt\ShipmentCommon\Base\Document;
7
use MrPrompt\ShipmentCommon\Base\Sequence;
8
use MrPrompt\ShipmentCommon\Base\Purchaser;
9
use MrPrompt\ShipmentCommon\Base\Dealership;
10
use MrPrompt\ShipmentCommon\Base\Occurrence;
11
use MrPrompt\ShipmentCommon\Base\Authorization;
12
use MrPrompt\ShipmentCommon\Base\ConsumerUnity;
13
14
/**
15
 * File detail
16
 *
17
 * @author Thiago Paes <[email protected]>
18
 */
19
class Detail extends \stdClass
20
{
21
    /**
22
     * Type of register
23
     *
24
     * @var string
25
     */
26
    const TYPE = 'D';
27
28
    /**
29
     * @var ConsumerUnity
30
     */
31
    private $consumerUnity;
32
33
    /**
34
     * @var Occurrence
35
     */
36
    private $occurrence;
37
38
    /**
39
     * @var Parcel
40
     */
41
    private $parcel;
42
43
    /**
44
     * @var Authorization
45
     */
46
    private $authorization;
47
48
    /**
49
     * @var Dealership
50
     */
51
    private $dealership;
52
53
    /**
54
     * @var Client
55
     */
56
    private $client;
57
58
    /**
59
     * @var Sequence
60
     */
61
    private $sequence;
62
63
    /**
64
     * @var Purchaser
65
     */
66
    private $purchaser;
67
68
    /**
69
     * Constructor
70
     * @param string $row
71
     */
72 17
    public function __construct($row)
73
    {
74 17
        $consumerUnity = new ConsumerUnity();
75 17
        $consumerUnity->setNumber((int) substr($row, 1, 25));
76
77 17
        $date       = substr($row, 28, 8);
78 17
        $occurrence = new Occurrence();
79 17
        $occurrence->setReturn(substr($row, 26, 2));
80 17
        $occurrence->setDate(\DateTime::createFromFormat('dmY', $date));
0 ignored issues
show
It seems like \DateTime::createFromFormat('dmY', $date) targeting DateTime::createFromFormat() can also be of type false; however, MrPrompt\ShipmentCommon\Base\Occurrence::setDate() does only seem to accept object<DateTime>, did you maybe forget to handle an error condition?
Loading history...
81 17
        $occurrence->setDescription(substr($row, 200, 50));
82
83 17
        $date   = substr($row, 126, 8);
84 17
        $parcel = new Parcel();
85 17
        $parcel->setPrice(substr($row, 54, 10));
86 17
        $parcel->setKey((int) substr($row, 257, 2));
87 17
        $parcel->setMaturity(\DateTime::createFromFormat('dmY', $date));
0 ignored issues
show
It seems like \DateTime::createFromFormat('dmY', $date) targeting DateTime::createFromFormat() can also be of type false; however, MrPrompt\ShipmentCommon\Base\Parcel::setMaturity() does only seem to accept object<DateTime>, did you maybe forget to handle an error condition?
Loading history...
88
89 17
        $document = new Document();
90 17
        $document->setNumber(preg_replace('/[^[:digit:]]/', '', substr($row, 134, 20)));
91
92 17
        $authorization = new Authorization();
93 17
        $authorization->setNumber((int) substr($row, 154, 10));
94
95 17
        $dealership = new Dealership();
96 17
        $dealership->setCode(substr($row, 164, 6));
97 17
        $dealership->setName(substr($row, 170, 30));
98
99 17
        $client = new Client();
100 17
        $client->setCode((int) substr($row, 369, 25));
101
102 17
        $purchaser = new Purchaser();
103 17
        $purchaser->setName(substr($row, 76, 50));
104 17
        $purchaser->setDocument($document);
105 17
        $purchaser->setSalaried(substr($row, 404, 1));
106
107 17
        $sequence = new Sequence(substr($row, 500, 6));
108
109 17
        $this->consumerUnity    = $consumerUnity;
110 17
        $this->occurrence       = $occurrence;
111 17
        $this->parcel           = $parcel;
112 17
        $this->authorization    = $authorization;
113 17
        $this->dealership       = $dealership;
114 17
        $this->client           = $client;
115 17
        $this->sequence         = $sequence;
116 17
        $this->purchaser        = $purchaser;
117 17
    }
118
119
    /**
120
     * @return ConsumerUnity
121
     */
122 1
    public function getConsumerUnity()
123
    {
124 1
        return $this->consumerUnity;
125
    }
126
127
    /**
128
     * @param ConsumerUnity $consumerUnity
129
     */
130 1
    public function setConsumerUnity(ConsumerUnity $consumerUnity)
131
    {
132 1
        $this->consumerUnity = $consumerUnity;
133 1
    }
134
135
    /**
136
     * @return Occurrence
137
     */
138 1
    public function getOccurrence()
139
    {
140 1
        return $this->occurrence;
141
    }
142
143
    /**
144
     * @param Occurrence $occurrence
145
     */
146 1
    public function setOccurrence(Occurrence $occurrence)
147
    {
148 1
        $this->occurrence = $occurrence;
149 1
    }
150
151
    /**
152
     * @return Parcel
153
     */
154 1
    public function getParcel()
155
    {
156 1
        return $this->parcel;
157
    }
158
159
    /**
160
     * @param Parcel $parcel
161
     */
162 1
    public function setParcel(Parcel $parcel)
163
    {
164 1
        $this->parcel = $parcel;
165 1
    }
166
167
    /**
168
     * @return Authorization
169
     */
170 1
    public function getAuthorization()
171
    {
172 1
        return $this->authorization;
173
    }
174
175
    /**
176
     * @param Authorization $authorization
177
     */
178 1
    public function setAuthorization(Authorization $authorization)
179
    {
180 1
        $this->authorization = $authorization;
181 1
    }
182
183
    /**
184
     * @return Dealership
185
     */
186 1
    public function getDealership()
187
    {
188 1
        return $this->dealership;
189
    }
190
191
    /**
192
     * @param Dealership $dealership
193
     */
194 1
    public function setDealership(Dealership $dealership)
195
    {
196 1
        $this->dealership = $dealership;
197 1
    }
198
199
    /**
200
     * @return Client
201
     */
202 1
    public function getClient()
203
    {
204 1
        return $this->client;
205
    }
206
207
    /**
208
     * @param Client $client
209
     */
210 1
    public function setClient(Client $client)
211
    {
212 1
        $this->client = $client;
213 1
    }
214
215
    /**
216
     * @return Sequence
217
     */
218 1
    public function getSequence()
219
    {
220 1
        return $this->sequence;
221
    }
222
223
    /**
224
     * @param Sequence $sequence
225
     */
226 1
    public function setSequence(Sequence $sequence)
227
    {
228 1
        $this->sequence = $sequence;
229 1
    }
230
231
    /**
232
     * @return Purchaser
233
     */
234 1
    public function getPurchaser()
235
    {
236 1
        return $this->purchaser;
237
    }
238
239
    /**
240
     * @param Purchaser $purchaser
241
     */
242 1
    public function setPurchaser(Purchaser $purchaser)
243
    {
244 1
        $this->purchaser = $purchaser;
245 1
    }
246
}
247