Issues (9)

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.

Model/Webhook.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 GorkaLaucirica\HipchatAPIv2Client\Model;
4
5
class Webhook
6
{
7
8
    /**
9
     * The unique identifier for the created entity
10
     * @var string|null
11
     */
12
    protected $id = null;
13
14
    /**
15
     * The URL to send the webhook POST to
16
     * @var string
17
     */
18
    protected $url;
19
20
    /**
21
     * The regular expression pattern to match against messages.
22
     * Only applicable for message events.
23
     * @var string
24
     */
25
    protected $pattern;
26
27
    /**
28
     * The event to listen for
29
     * Valid values:
30
     *    room_message, room_notification, room_exit, room_enter, room_topic_change.
31
     * @var string
32
     */
33
    protected $event;
34
35
    /**
36
     * The label for this webhook
37
     * @var string
38
     */
39
    protected $name;
40
41
    /**
42
     * URLs to retrieve webhook information
43
     * @var array
44
     */
45
    protected $links;
46
47
    /**
48
     * Webhook constructor
49
     */
50
    public function __construct($json = null)
51
    {
52
        if ($json) {
53
            $this->parseJson($json);
54
        } else {
55
            $this->url = '';
56
            $this->pattern = '';
57
            $this->event = 'room_message';
58
            $this->name = '';
59
            $this->links = '';
0 ignored issues
show
Documentation Bug introduced by
It seems like '' of type string is incompatible with the declared type array of property $links.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
60
        }
61
    }
62
63
    public function parseJson($json)
64
    {
65
        $this->id = isset($json['id']) ? $json['id'] : null;
66
        $this->url = $json['url'];
67
        $this->pattern = $json['pattern'];
68
        $this->event = $json['event'];
69
        $this->name = $json['name'];
70
        $this->links = (isset($json['links']) && is_array($json['links'])) ? $json['links'] : array();
71
    }
72
73
74
    /**
75
     * Serializes Webhook object
76
     *
77
     * @return array
78
     */
79
    public function toJson()
80
    {
81
        $json = array();
82
        $json['id'] = $this->id;
83
        $json['url'] = $this->url;
84
        $json['pattern'] = $this->pattern;
85
        $json['event'] = $this->event;
86
        $json['name'] = $this->name;
87
        $json['links'] = $this->links;
88
89
        return $json;
90
    }
91
92
    /**
93
     * Gets the unique identifier for the created entity
94
     * @return null|string
95
     */
96
    public function getId()
97
    {
98
        return $this->id;
99
    }
100
101
    /**
102
     * Sets the unique identifier for the created entity
103
     * @param null|string $id
104
     * @return self
105
     */
106
    public function setId($id)
107
    {
108
        $this->id = $id;
109
        return $this;
110
    }
111
112
    /**
113
     * Gets the event to listen for
114
     *
115
     * @return string
116
     */
117
    public function getEvent() {
118
        return $this->event;
119
    }
120
121
    /**
122
     * Sets the event to listen for
123
     *
124
     * @param string $event
125
     * @return self
126
     */
127
    public function setEvent($event) {
128
        $this->event = $event;
129
        return $this;
130
    }
131
132
    /**
133
     * Gets the URLs to retrieve webhook information
134
     * @return array
135
     */
136
    public function getLinks()
137
    {
138
        return $this->links;
139
    }
140
141
    /**
142
     * Sets the URLs to retrieve webhook information
143
     * @param array $links
144
     * @return self
145
     */
146
    public function setLinks($links)
147
    {
148
        $this->links = $links;
149
        return $this;
150
    }
151
152
    /**
153
     * Gets the label for this webhook
154
     * @return string
155
     */
156
    public function getName()
157
    {
158
        return $this->name;
159
    }
160
161
    /**
162
     * Sets the label for this webhook
163
     * @param string $name
164
     * @return self
165
     */
166
    public function setName($name)
167
    {
168
        $this->name = $name;
169
        return $this;
170
    }
171
172
    /**
173
     * Gets the regular expression pattern to match against messages.
174
     * @return string
175
     */
176
    public function getPattern()
177
    {
178
        return $this->pattern;
179
    }
180
181
    /**
182
     * Sets the regular expression pattern to match against messages.
183
     * @param string $pattern
184
     * @return self
185
     */
186
    public function setPattern($pattern)
187
    {
188
        $this->pattern = $pattern;
189
        return $this;
190
    }
191
192
    /**
193
     * Gets the URL to send the webhook POST to
194
     * @return string
195
     */
196
    public function getUrl()
197
    {
198
        return $this->url;
199
    }
200
201
    /**
202
     * Sets the URL to send the webhook POST to
203
     * @param string $url
204
     * @return self
205
     */
206
    public function setUrl($url)
207
    {
208
        $this->url = $url;
209
        return $this;
210
    }
211
212
}
213