EmailEvents   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 62
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCampaignIds() 0 8 1
A getCampaignById() 0 8 1
A all() 0 8 1
A getById() 0 6 1
1
<?php
2
3
namespace SevenShores\Hubspot\Resources;
4
5
class EmailEvents extends Resource
6
{
7
    /**
8
     * Get campaign IDs for a portal.
9
     *
10
     * @param array $params Optional parameters
11
     * @return \SevenShores\Hubspot\Http\Response
12
     */
13
    function getCampaignIds($params = [])
0 ignored issues
show
Best Practice introduced by
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...
14
    {
15
        $endpoint = "https://api.hubapi.com/email/public/v1/campaigns";
16
17
        $queryString = build_query_string($params);
18
19
        return $this->client->request('get', $endpoint, [], $queryString);
20
    }
21
22
    /**
23
     * Get campaign data for a given campaign.
24
     *
25
     * @param int $campaign_id
26
     * @param int $application_id
27
     * @return \SevenShores\Hubspot\Http\Response
28
     */
29
    function getCampaignById($campaign_id, $application_id)
0 ignored issues
show
Best Practice introduced by
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...
30
    {
31
        $endpoint = "https://api.hubapi.com/email/public/v1/campaigns/{$campaign_id}";
32
33
        $queryString = build_query_string(['appId' => $application_id]);
34
35
        return $this->client->request('get', $endpoint, [], $queryString);
36
    }
37
38
    /**
39
     * Get email events for a campaign or recipient.
40
     *
41
     * @param array $params Optional parameters
42
     * @return \SevenShores\Hubspot\Http\Response
43
     */
44
    function all($params = [])
0 ignored issues
show
Best Practice introduced by
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...
45
    {
46
        $endpoint = "https://api.hubapi.com/email/public/v1/events";
47
48
        $queryString = build_query_string($params);
49
50
        return $this->client->request('get', $endpoint, [], $queryString);
51
    }
52
53
    /**
54
     * Get event data for a specific event.
55
     *
56
     * @param int $id      The event ID
57
     * @param int $created Timestamp (milliseconds) when the event was created
58
     * @return \SevenShores\Hubspot\Http\Response
59
     */
60
    function getById($id, $created)
0 ignored issues
show
Best Practice introduced by
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...
61
    {
62
        $endpoint = "https://api.hubapi.com/email/public/v1/events/{$created}/{$id}";
63
64
        return $this->client->request('get', $endpoint);
65
    }
66
}
67