Issues (17)

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/entity/Segment.php (8 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
3
namespace Audiens\DoubleclickClient\entity;
4
5
use Audiens\DoubleclickClient\exceptions\ClientException;
6
7
class Segment
8
{
9
    /** @var int */
10
    protected $segmentId;
11
12
    /** @var string */
13
    protected $segmentName;
14
15
    /** @var string */
16
    protected $segmentStatus;
17
18
    /** @var null|string */
19
    protected $description;
20
21
    /** @var null|string */
22
    protected $integrationCode;
23
24
    /** @var null|string */
25
    protected $accountUserListStatus;
26
27
    /** @var null */
28
    protected $accessReason;
29
30
    /** @var null */
31
    protected $isEligibleForSearch;
32
33
    /** @var null */
34
    protected $membershipLifeSpan;
35
36
    /** @var string */
37
    protected $listType;
38
39
    /** @var string */
40
    protected $size;
41
42
    public function __construct($segmentId, $segmentName, $segmentStatus, $description = null, $integrationCode = null, $accountUserListStatus = null, $accessReason = null, $isEligibleForSearch = null, $membershipLifeSpan = null)
43
    {
44
        $this->segmentId             = $segmentId;
45
        $this->segmentName           = $segmentName;
46
        $this->segmentStatus         = $segmentStatus;
47
        $this->description           = $description;
48
        $this->integrationCode       = $integrationCode;
49
        $this->accountUserListStatus = $accountUserListStatus;
50
        $this->accessReason          = $accessReason;
51
        $this->isEligibleForSearch   = $isEligibleForSearch;
52
        $this->membershipLifeSpan    = $membershipLifeSpan;
53
    }
54
55
    /**
56
     * @return int
57
     */
58
    public function getSegmentId()
59
    {
60
        return $this->segmentId;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getSegmentName()
67
    {
68
        return $this->segmentName;
69
    }
70
71
    /**
72
     * @param $name
73
     */
74
    public function setSegmentName($name)
75
    {
76
        $this->segmentName = $name;
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getSegmentStatus()
83
    {
84
        return $this->segmentStatus;
85
    }
86
87
    /**
88
     * @return string
89
     */
90
    public function getDescription()
91
    {
92
        return $this->description;
93
    }
94
95
    /**
96
     * @param string $description
97
     */
98
    public function setDescription($description)
99
    {
100
        $this->description = $description;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getIntegrationCode()
107
    {
108
        return $this->integrationCode;
109
    }
110
111
    /**
112
     * @param string $integrationCode
113
     */
114
    public function setIntegrationCode($integrationCode)
115
    {
116
        $this->integrationCode = $integrationCode;
117
    }
118
119
    /**
120
     * @return string
121
     */
122
    public function getAccountUserListStatus()
123
    {
124
        return $this->accountUserListStatus;
125
    }
126
127
    /**
128
     * @param string $accountUserListStatus
129
     */
130
    public function setAccountUserListStatus($accountUserListStatus)
131
    {
132
        $this->accountUserListStatus = $accountUserListStatus;
133
    }
134
135
    /**
136
     * @return mixed
137
     */
138
    public function getAccessReason()
139
    {
140
        return $this->accessReason;
141
    }
142
143
    /**
144
     * @param mixed $accessReason
145
     */
146
    public function setAccessReason($accessReason)
147
    {
148
        $this->accessReason = $accessReason;
149
    }
150
151
    /**
152
     * @return mixed
153
     */
154
    public function getisEligibleForSearch()
155
    {
156
        return $this->isEligibleForSearch;
157
    }
158
159
    /**
160
     * @param mixed $isEligibleForSearch
161
     */
162
    public function setIsEligibleForSearch($isEligibleForSearch)
163
    {
164
        $this->isEligibleForSearch = $isEligibleForSearch;
165
    }
166
167
    /**
168
     * @return mixed
169
     */
170
    public function getMembershipLifeSpan()
171
    {
172
        return $this->membershipLifeSpan;
173
    }
174
175
    /**
176
     * @param mixed $membershipLifeSpan
177
     */
178
    public function setMembershipLifeSpan($membershipLifeSpan)
179
    {
180
        $this->membershipLifeSpan = $membershipLifeSpan;
181
    }
182
183
    /**
184
     * @return mixed
185
     */
186
    public function getListType()
187
    {
188
        return $this->listType;
189
    }
190
191
    /**
192
     * @param  $listType
193
     */
194
    public function setListType($listType)
195
    {
196
        $this->listType = $listType;
197
    }
198
199
    /**
200
     * @return mixed
201
     */
202
    public function getSize()
203
    {
204
        return $this->size;
205
    }
206
207
    /**
208
     * @param mixed $size
209
     */
210
    public function setSize($size)
211
    {
212
        $this->size = $size;
213
    }
214
215
    public static function fromArray(array $array)
216
    {
217
        if (!isset($array['id'])) {
218
            throw ClientException::validation('hydration: id');
219
        }
220
221
        if (!isset($array['name'])) {
222
            throw ClientException::validation('hydration: name');
223
        }
224
225
        if (!isset($array['status'])) {
226
            throw ClientException::validation('hydration: status');
227
        }
228
229
        $segment = new self(
230
            $array['id'],
231
            $array['name'],
232
            $array['status']
233
        );
234
235 View Code Duplication
        if (isset($array['description']) && !is_array($array['description'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
236
            $segment->setDescription($array['description']);
237
        }
238
239 View Code Duplication
        if (isset($array['accountuserliststatus']) && !is_array($array['accountuserliststatus'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
240
            $segment->setAccountUserListStatus($array['accountuserliststatus']);
241
        }
242 View Code Duplication
        if (isset($array['accessreason']) && !is_array($array['accessreason'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
243
            $segment->setAccessReason($array['accessreason']);
244
        }
245
246 View Code Duplication
        if (isset($array['iseligibleforsearch']) && !is_array($array['iseligibleforsearch'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
247
            $segment->setIsEligibleForSearch($array['iseligibleforsearch']);
248
        }
249 View Code Duplication
        if (isset($array['membershiplifespan']) && !is_array($array['membershiplifespan'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
250
            $segment->setMembershipLifeSpan($array['membershiplifespan']);
251
        }
252
253 View Code Duplication
        if (isset($array['listtype']) && !is_array($array['listtype'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
254
            $segment->setListType($array['listtype']);
255
        }
256
257 View Code Duplication
        if (isset($array['size']) && !is_array($array['size'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
258
            $segment->setSize($array['size']);
259
        }
260
261 View Code Duplication
        if (isset($array['integrationcode']) && !is_array($array['integrationcode'])) {
0 ignored issues
show
This code seems to be duplicated across 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...
262
            $segment->setIntegrationCode($array['integrationcode']);
263
        }
264
265
        return $segment;
266
    }
267
}
268