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/Analytics.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 SevenShores\Hubspot\Resources;
4
5
class Analytics extends Resource
6
{
7
    /**
8
     * Get analytics data broken down by the specified category.
9
     *
10
     * @see https://developers.hubspot.com/docs/methods/analytics/get-analytics-data-breakdowns
11
     *
12
     * @param string $breakdown_by
13
     * @param string $time_period
14
     * @param string $startDate (YYYYMMDD)
15
     * @param string $endDate (YYYYMMDD)
16
     * @param array $params Array of optional parameters ['filterId', 'sort', 'sortDir','limit', 'offset']
17
     * @return \SevenShores\Hubspot\Http\Response
18
     */
19
    function getByCategory($breakdown_by, $time_period, $startDate, $endDate, $params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
20
    {
21
        $endpoint = "https://api.hubapi.com/analytics/v2/reports/{$breakdown_by}/{$time_period}";
22
        $params = array_merge(compact('startDate', 'endDate'), $params);
23
24
        $queryString = build_query_string($params);
25
26
        return $this->client->request('get', $endpoint, [], $queryString);
27
    }
28
29
    /**
30
     * Get analytics data for specific objects, based on the type of object.
31
     *
32
     * @see https://developers.hubspot.com/docs/methods/analytics/get-analytics-data-by-object
33
     *
34
     * @param string $object_type
35
     * @param string $time_period
36
     * @param string $startDate (YYYYMMDD)
37
     * @param string $endDate (YYYYMMDD)
38
     * @param array $params Array of optional parameters ['filterId', 'sort', 'sortDir','limit', 'offset']
39
     * @return \SevenShores\Hubspot\Http\Response
40
     */
41
    function getByType($object_type, $time_period, $startDate, $endDate, $params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
42
    {
43
        $endpoint = "https://api.hubapi.com/analytics/v2/reports/{$object_type}/{$time_period}";
44
        $params = array_merge(compact('startDate', 'endDate'), $params);
45
46
        $queryString = build_query_string($params);
47
48
        return $this->client->request('get', $endpoint, [], $queryString);
49
    }
50
51
    /**
52
     * Get analytics data for your HubSpot hosted content.
53
     *
54
     * @see https://developers.hubspot.com/docs/methods/analytics/get-data-for-hubspot-content
55
     *
56
     * @param string $content_type
57
     * @param string $time_period
58
     * @param string $startDate (YYYYMMDD)
59
     * @param string $endDate (YYYYMMDD)
60
     * @param array $params Array of optional parameters ['filterId', 'sort', 'sortDir','limit', 'offset']
61
     * @return \SevenShores\Hubspot\Http\Response
62
     */
63
    function getHosted($content_type, $time_period, $startDate, $endDate, $params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
64
    {
65
        $endpoint = "https://api.hubapi.com/analytics/v2/reports/{$content_type}/{$time_period}";
66
        $params = array_merge(compact('startDate', 'endDate'), $params);
67
68
        $queryString = build_query_string($params);
69
70
        return $this->client->request('get', $endpoint, [], $queryString);
71
    }
72
73
    /**
74
     * Get Events.
75
     *
76
     * @see https://developers.hubspot.com/docs/methods/events/get_events
77
     *
78
     * @param array $params Array of optional parameters ['includeDeletes']
79
     * @return \SevenShores\Hubspot\Http\Response
80
     */
81
    function getEvents($params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
82
    {
83
        $endpoint = "https://api.hubapi.com/reports/v2/events";
84
85
        $queryString = build_query_string($params);
86
87
        return $this->client->request('get', $endpoint, [], $queryString);
88
    }
89
90
    /**
91
     * Get all analytics views
92
     *
93
     * @see https://developers.hubspot.com/docs/methods/analytics-views/get-views
94
     *
95
     * @param array $params Array of optional parameters
96
     * @return \SevenShores\Hubspot\Http\Response
97
     */
98
    function getViews($params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
99
    {
100
        $endpoint = "https://api.hubapi.com/analytics/v2/views";
101
102
        $queryString = build_query_string($params);
103
104
        return $this->client->request('get', $endpoint, [], $queryString);
105
    }
106
107
    /**
108
     * Get a Group of Events by ID
109
     *
110
     * @see https://developers.hubspot.com/docs/methods/events/get_events_by_id
111
     *
112
     * @param string $id Can be included multiple times to pull multiple events.
113
     * @param array $params Array of optional parameters ['includeDeletes']
114
     * @return \SevenShores\Hubspot\Http\Response
115
     */
116
    function getEventsById($id, $params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
117
    {
118
        $endpoint = "https://api.hubapi.com/analytics/v2/views";
119
120
        $queryString = build_query_string($params);
121
122
        $params['id'] = $id;
123
124
        return $this->client->request('get', $endpoint, [], $queryString);
125
    }
126
127
    /**
128
     * Check for the existence of analytics data for an object type
129
     *
130
     * @see https://developers.hubspot.com/docs/methods/analytics/check_for_analytics_data_existence
131
     *
132
     * @param string $id
0 ignored issues
show
There is no parameter named $id. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
133
     * @param array $params Array of optional parameters
134
     * @return \SevenShores\Hubspot\Http\Response
135
     */
136
    function checkForExistence($objectType, $params = [])
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
137
    {
138
        $endpoint = "https://api.hubapi.com/analytics/v2/reports/{$objectType}/exists";
139
140
        $queryString = build_query_string($params);
141
142
        return $this->client->request('get', $endpoint, [], $queryString);
143
    }
144
}
145