Issues (12)

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/Models/Address.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
namespace OceanApplications\Postmen\Models;
4
5
class Address extends Model
6
{
7
    public $country;
8
    public $contact_name;
9
    public $phone;
10
    public $fax;
11
    public $email;
12
    public $company_name;
13
    public $street1;
14
    public $street2;
15
    public $street3;
16
    public $city;
17
    public $state;
18
    public $postal_code;
19
    public $type = 'residential';
20
    public $tax_id;
21
22
    /**
23
     * @param string $value
24
     *
25
     * @throws \Exception
26
     *
27
     * @return $this
28
     */
29 View Code Duplication
    public function country($value)
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        if (in_array($value, $this->acceptedCountries)) {
32
            $this->country = $value;
33
        } else {
34
            $error = 'Country code invalid or not serviceable';
35
            throw new \Exception($error);
36
        }
37
38
        return $this;
39
    }
40
41
    /**
42
     * @param string $value
43
     *
44
     * @return $this
45
     */
46
    public function contact_name($value)
47
    {
48
        $this->contact_name = strval($value);
49
50
        return $this;
51
    }
52
53
    /**
54
     * @param string $value
55
     *
56
     * @return $this
57
     */
58
    public function phone($value)
59
    {
60
        $this->phone = strval($value);
61
62
        return $this;
63
    }
64
65
    /**
66
     * @param string $value
67
     *
68
     * @return $this
69
     */
70
    public function fax($value)
71
    {
72
        $this->fax = strval($value);
73
74
        return $this;
75
    }
76
77
    /**
78
     * @param string $value
79
     *
80
     * @return $this
81
     */
82
    public function email($value)
83
    {
84
        $this->email = strval($value);
85
86
        return $this;
87
    }
88
89
    /**
90
     * @param string $value
91
     *
92
     * @return $this
93
     */
94
    public function company_name($value)
95
    {
96
        $this->company_name = strval($value);
97
98
        return $this;
99
    }
100
101
    /**
102
     * @param string $value
103
     *
104
     * @return $this
105
     */
106
    public function street1($value)
107
    {
108
        $this->street1 = strval($value);
109
110
        return $this;
111
    }
112
113
    /**
114
     * @param string $value
115
     *
116
     * @return $this
117
     */
118
    public function street2($value)
119
    {
120
        if (empty($value)) {
121
            $this->street2 = null;
122
        } else {
123
            $this->street2 = strval($value);
124
        }
125
126
        return $this;
127
    }
128
129
    /**
130
     * @param string $value
131
     *
132
     * @return $this
133
     */
134
    public function street3($value)
135
    {
136
        if (empty($value)) {
137
            $this->street3 = null;
138
        } else {
139
            $this->street3 = strval($value);
140
        }
141
142
        return $this;
143
    }
144
145
    /**
146
     * @param string $value
147
     *
148
     * @return $this
149
     */
150
    public function city($value)
151
    {
152
        $this->city = strval($value);
153
154
        return $this;
155
    }
156
157
    /**
158
     * @param string $value
159
     *
160
     * @return $this
161
     */
162
    public function state($value)
163
    {
164
        $this->state = strval($value);
165
166
        return $this;
167
    }
168
169
    /**
170
     * @param string $value
171
     *
172
     * @return $this
173
     */
174
    public function postal_code($value)
175
    {
176
        $this->postal_code = strval($value);
177
178
        return $this;
179
    }
180
181
    /**
182
     * @param string $value
183
     *
184
     * @throws \Exception
185
     *
186
     * @return $this
187
     */
188
    public function type($value)
189
    {
190
        if ($value != 'residential' || $value != 'business') {
191
            $error = 'Type must be residential or business.';
192
            throw new \Exception($error);
193
        }
194
        $this->type = $value;
195
196
        return $this;
197
    }
198
199
    /**
200
     * @param string $value
201
     *
202
     * @return $this
203
     */
204
    public function tax_id($value)
205
    {
206
        $this->tax_id = strval($value);
207
208
        return $this;
209
    }
210
}
211