Issues (51)

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/Model/Quest.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
2
namespace Wonnova\SDK\Model;
3
4
use Doctrine\Common\Collections\ArrayCollection;
5
use Doctrine\Common\Collections\Collection;
6
use JMS\Serializer\Annotation as JMS;
7
use Wonnova\SDK\Common\WonnovaDateTimeParserTrait;
8
9
/**
10
 * Class Quest
11
 * @author Wonnova
12
 * @link http://www.wonnova.com
13
 */
14
class Quest extends AbstractModel
15
{
16
    use WonnovaDateTimeParserTrait;
17
18
    /**
19
     * @var \DateTime
20
     * @JMS\Type("WonnovaDateTime")
21
     */
22
    private $startDate;
23
    /**
24
     * @var string
25
     * @JMS\Type("string")
26
     */
27
    private $code;
28
    /**
29
     * @var bool
30
     * @JMS\Type("boolean")
31
     */
32
    private $generatesNotification;
33
    /**
34
     * @var string
35
     * @JMS\Type("string")
36
     */
37
    private $name;
38
    /**
39
     * @var string
40
     * @JMS\Type("string")
41
     */
42
    private $description;
43
    /**
44
     * @var int
45
     * @JMS\Type("integer")
46
     * @JMS\Accessor(getter="getProgress",setter="setProgress")
47
     */
48
    private $progress;
49
    /**
50
     * @var Collection|QuestStep[]
51
     * @JMS\Type("array<Wonnova\SDK\Model\QuestStep>")
52
     */
53
    private $questSteps;
54
55
    /**
56
     * @return \DateTime
57
     */
58 2
    public function getStartDate()
59
    {
60 2
        return $this->startDate;
61
    }
62
63
    /**
64
     * @param \DateTime|string $startDate
65
     * @return $this
66
     */
67 1
    public function setStartDate($startDate)
68
    {
69 1
        $this->startDate = $this->parseWonnovaDateTime($startDate);
70 1
        return $this;
71
    }
72
73
    /**
74
     * @return string
75
     */
76 3
    public function getCode()
77
    {
78 3
        return $this->code;
79
    }
80
81
    /**
82
     * @param string $code
83
     * @return $this
84
     */
85 1
    public function setCode($code)
86
    {
87 1
        $this->code = $code;
88 1
        return $this;
89
    }
90
91
    /**
92
     * @return mixed
93
     */
94 2
    public function getGeneratesNotification()
95
    {
96 2
        return $this->generatesNotification;
97
    }
98
99
    /**
100
     * @param mixed $generatesNotification
101
     * @return $this
102
     */
103 1
    public function setGeneratesNotification($generatesNotification)
104
    {
105 1
        $this->generatesNotification = $generatesNotification;
106 1
        return $this;
107
    }
108
109
    /**
110
     * @return string
111
     */
112 3
    public function getName()
113
    {
114 3
        return $this->name;
115
    }
116
117
    /**
118
     * @param string $name
119
     * @return $this
120
     */
121 1
    public function setName($name)
122
    {
123 1
        $this->name = $name;
124 1
        return $this;
125
    }
126
127
    /**
128
     * @return string
129
     */
130 2
    public function getDescription()
131
    {
132 2
        return $this->description;
133
    }
134
135
    /**
136
     * @param string $description
137
     * @return $this
138
     */
139 1
    public function setDescription($description)
140
    {
141 1
        $this->description = $description;
142 1
        return $this;
143
    }
144
145
    /**
146
     * @return int
147
     */
148 2
    public function getProgress()
149
    {
150 2
        return $this->progress;
151
    }
152
153
    /**
154
     * @param int $progress
155
     * @return $this
156
     */
157 2
    public function setProgress($progress)
158
    {
159 2
        $this->progress = $progress;
160 2
        return $this;
161
    }
162
163
    /**
164
     * @return Collection|QuestStep[]
165
     */
166 2
    public function getQuestSteps()
167
    {
168 2
        return $this->questSteps;
169
    }
170
171
    /**
172
     * @param Collection|QuestStep[] $questSteps
173
     * @return $this
174
     */
175 1
    public function setQuestSteps($questSteps)
176
    {
177 1
        $this->questSteps = is_array($questSteps) ? new ArrayCollection($questSteps) : $questSteps;
178 1
        return $this;
179
    }
180
181
    /**
182
     * This method is called via reflection, so it doesn't need to (and shouldn't) be exposed
183
     * It prevents the properties progress and questSteps to be null
184
     *
185
     * @JMS\PostDeserialize
186
     */
187 2
    private function postDeserialize()
188
    {
189 2
        if (is_null($this->progress)) {
190 1
            $this->progress = 0;
191 1
        }
192 2
        $this->questSteps = new ArrayCollection(is_null($this->questSteps) ? [] : $this->questSteps);
0 ignored issues
show
It seems like is_null($this->questStep...y() : $this->questSteps can also be of type object<Doctrine\Common\Collections\Collection>; however, Doctrine\Common\Collecti...llection::__construct() does only seem to accept array, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
193 2
    }
194
}
195