Issues (318)

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/Resources/CalendarEvents.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 SevenShores\Hubspot\Resources;
4
5
class CalendarEvents extends Resource
6
{
7
    /**
8
     * @param array $properties
9
     *
10
     * @return \SevenShores\Hubspot\Http\Response
11
     */
12
    public function createTask($properties)
13
    {
14
        $endpoint = 'https://api.hubapi.com/calendar/v1/events/task';
15
        $options['json'] = $properties;
16
17
        return $this->client->request('post', $endpoint, $options);
18
    }
19
20
    /**
21
     * @param int   $id         The task id.
22
     * @param array $properties The task properties to update.
23
     *
24
     * @return \SevenShores\Hubspot\Http\Response
25
     */
26
    public function updateTask($id, $properties)
27
    {
28
        $endpoint = "https://api.hubapi.com/calendar/v1/events/task/{$id}";
29
30
        $options['json'] = $properties;
0 ignored issues
show
Coding Style Comprehensibility introduced by
$options was never initialized. Although not strictly required by PHP, it is generally a good practice to add $options = array(); before regardless.

Adding an explicit array definition is generally preferable to implicit array definition as it guarantees a stable state of the code.

Let’s take a look at an example:

foreach ($collection as $item) {
    $myArray['foo'] = $item->getFoo();

    if ($item->hasBar()) {
        $myArray['bar'] = $item->getBar();
    }

    // do something with $myArray
}

As you can see in this example, the array $myArray is initialized the first time when the foreach loop is entered. You can also see that the value of the bar key is only written conditionally; thus, its value might result from a previous iteration.

This might or might not be intended. To make your intention clear, your code more readible and to avoid accidental bugs, we recommend to add an explicit initialization $myArray = array() either outside or inside the foreach loop.

Loading history...
31
32
        return $this->client->request('put', $endpoint, $options);
33
    }
34
35
    /**
36
     * @param int $id
37
     *
38
     * @return \SevenShores\Hubspot\Http\Response
39
     */
40
    public function getTaskById($id)
41
    {
42
        $endpoint = "https://api.hubapi.com/calendar/v1/events/task/{$id}";
43
44
        return $this->client->request('get', $endpoint);
45
    }
46
47
    /**
48
     * @param int $id
49
     * @return \SevenShores\Hubspot\Http\Response
50
     */
51
    public function deleteTask($id)
52
    {
53
        $endpoint = "https://api.hubapi.com/calendar/v1/events/task/{$id}";
54
55
        return $this->client->request('delete', $endpoint);
56
    }
57
58
    /**
59
     * Get an aggregation for all calendar event types.
60
     *
61
     *
62
     * @see https://developers.hubspot.com/docs/methods/calendar/list-events
63
     *
64
     * @param int $startDate    The beginning value of the query range, in UTC, in milliseconds
65
     * @param int $endDate      The end value of the query range, in UTC, in milliseconds
66
     * @param array $params     Array of optional parameters:
67
     *                          limit, type, campaignGuid, contentCategory, includeNoCampaigns
68
     *
69
     * @return \SevenShores\Hubspot\Http\Response
70
     */
71 View Code Duplication
    public function all($startDate, $endDate, $params = [])
72
    {
73
        $endpoint = "https://api.hubapi.com/calendar/v1/events";
74
        $params = array_merge(compact('startDate', 'endDate'), $params);
75
76
        $queryString = build_query_string($params);
77
78
        return $this->client->request('get', $endpoint, [], $queryString);
79
    }
80
81
    /**
82
     * Retrieve task events for Calendar.
83
     * A shortcut of the standard events call for finer-grained control.
84
     *
85
     * @see https://developers.hubspot.com/docs/methods/calendar/list-tasks
86
     *
87
     * @param int $startDate    The beginning value of the query range, in UTC, in milliseconds
88
     * @param int $endDate      The end value of the query range, in UTC, in milliseconds
89
     * @param array $params     Array of optional parameters:
90
     *                          limit, campaignGuid, includeNoCampaigns
91
     *
92
     * @return \SevenShores\Hubspot\Http\Response
93
     */
94 View Code Duplication
    public function allTasks($startDate, $endDate, $params = [])
95
    {
96
        $endpoint = "https://api.hubapi.com/calendar/v1/events/task";
97
        $params = array_merge(compact('startDate', 'endDate'), $params);
98
99
        $queryString = build_query_string($params);
100
101
        return $this->client->request('get', $endpoint, [], $queryString);
102
    }
103
104
    /**
105
     * Retrieve social events for Calendar.
106
     * A shortcut of the standard events call for finer-grained control.
107
     *
108
     * @see https://developers.hubspot.com/docs/methods/calendar/list-social-events
109
     *
110
     * @param int $startDate    The beginning value of the query range, in UTC, in milliseconds
111
     * @param int $endDate      The end value of the query range, in UTC, in milliseconds
112
     * @param array $params     Array of optional parameters:
113
     *                          limit, offset, campaignGuid, includeNoCampaigns
114
     *
115
     * @return \SevenShores\Hubspot\Http\Response
116
     */
117 View Code Duplication
    public function allSocialEvents($startDate, $endDate, $params = [])
118
    {
119
        $endpoint = "https://api.hubapi.com/calendar/v1/events/social";
120
        $params = array_merge(compact('startDate', 'endDate'), $params);
121
122
        $queryString = build_query_string($params);
123
124
        return $this->client->request('get', $endpoint, [], $queryString);
125
    }
126
127
    /**
128
     * List content events.
129
     * Get events from the calendar.
130
     *
131
     * @see https://developers.hubspot.com/docs/methods/calendar/list-content-events
132
     *
133
     * @param int $startDate    The beginning value of the query range, in UTC, in milliseconds
134
     * @param int $endDate      The end value of the query range, in UTC, in milliseconds
135
     * @param array $params     Array of optional parameters:
136
     *                          limit, offset, contentCategory, campaignGuid, includeNoCampaigns
137
     *
138
     * @return \SevenShores\Hubspot\Http\Response
139
     */
140 View Code Duplication
    public function allContentEvents($startDate, $endDate, $params = [])
141
    {
142
        $endpoint = "https://api.hubapi.com/calendar/v1/events/content";
143
        $params = array_merge(compact('startDate', 'endDate'), $params);
144
145
        $queryString = build_query_string($params);
146
147
        return $this->client->request('get', $endpoint, [], $queryString);
148
    }
149
}
150