Passed
Push — master ( d156dd...acd975 )
by Thomas
04:20 queued 01:05
created

Mandrill_Users   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 132
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 132
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A senders() 0 4 1
A __construct() 0 3 1
A info() 0 4 1
A ping() 0 4 1
A ping2() 0 4 1
1
<?php
2
3
class Mandrill_Users
4
{
5
6
    public function __construct(Mandrill $master)
7
    {
8
        $this->master = $master;
0 ignored issues
show
Bug Best Practice introduced by
The property master does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
9
    }
10
11
    /**
12
     * Return the information about the API-connected user
13
     * @return struct the user information including username, key, reputation, quota, and historical sending stats
0 ignored issues
show
Bug introduced by
The type struct was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
     *     - username string the username of the user (used for SMTP authentication)
15
     *     - created_at string the date and time that the user's Mandrill account was created as a UTC string in YYYY-MM-DD HH:MM:SS format
16
     *     - public_id string a unique, permanent identifier for this user
17
     *     - reputation integer the reputation of the user on a scale from 0 to 100, with 75 generally being a "good" reputation
18
     *     - hourly_quota integer the maximum number of emails Mandrill will deliver for this user each hour.  Any emails beyond that will be accepted and queued for later delivery.  Users with higher reputations will have higher hourly quotas
19
     *     - backlog integer the number of emails that are queued for delivery due to exceeding your monthly or hourly quotas
20
     *     - stats struct an aggregate summary of the account's sending stats
21
     *         - today struct stats for this user so far today
22
     *             - sent integer the number of emails sent for this user so far today
23
     *             - hard_bounces integer the number of emails hard bounced for this user so far today
24
     *             - soft_bounces integer the number of emails soft bounced for this user so far today
25
     *             - rejects integer the number of emails rejected for sending this user so far today
26
     *             - complaints integer the number of spam complaints for this user so far today
27
     *             - unsubs integer the number of unsubscribes for this user so far today
28
     *             - opens integer the number of times emails have been opened for this user so far today
29
     *             - unique_opens integer the number of unique opens for emails sent for this user so far today
30
     *             - clicks integer the number of URLs that have been clicked for this user so far today
31
     *             - unique_clicks integer the number of unique clicks for emails sent for this user so far today
32
     *         - last_7_days struct stats for this user in the last 7 days
33
     *             - sent integer the number of emails sent for this user in the last 7 days
34
     *             - hard_bounces integer the number of emails hard bounced for this user in the last 7 days
35
     *             - soft_bounces integer the number of emails soft bounced for this user in the last 7 days
36
     *             - rejects integer the number of emails rejected for sending this user in the last 7 days
37
     *             - complaints integer the number of spam complaints for this user in the last 7 days
38
     *             - unsubs integer the number of unsubscribes for this user in the last 7 days
39
     *             - opens integer the number of times emails have been opened for this user in the last 7 days
40
     *             - unique_opens integer the number of unique opens for emails sent for this user in the last 7 days
41
     *             - clicks integer the number of URLs that have been clicked for this user in the last 7 days
42
     *             - unique_clicks integer the number of unique clicks for emails sent for this user in the last 7 days
43
     *         - last_30_days struct stats for this user in the last 30 days
44
     *             - sent integer the number of emails sent for this user in the last 30 days
45
     *             - hard_bounces integer the number of emails hard bounced for this user in the last 30 days
46
     *             - soft_bounces integer the number of emails soft bounced for this user in the last 30 days
47
     *             - rejects integer the number of emails rejected for sending this user in the last 30 days
48
     *             - complaints integer the number of spam complaints for this user in the last 30 days
49
     *             - unsubs integer the number of unsubscribes for this user in the last 30 days
50
     *             - opens integer the number of times emails have been opened for this user in the last 30 days
51
     *             - unique_opens integer the number of unique opens for emails sent for this user in the last 30 days
52
     *             - clicks integer the number of URLs that have been clicked for this user in the last 30 days
53
     *             - unique_clicks integer the number of unique clicks for emails sent for this user in the last 30 days
54
     *         - last_60_days struct stats for this user in the last 60 days
55
     *             - sent integer the number of emails sent for this user in the last 60 days
56
     *             - hard_bounces integer the number of emails hard bounced for this user in the last 60 days
57
     *             - soft_bounces integer the number of emails soft bounced for this user in the last 60 days
58
     *             - rejects integer the number of emails rejected for sending this user in the last 60 days
59
     *             - complaints integer the number of spam complaints for this user in the last 60 days
60
     *             - unsubs integer the number of unsubscribes for this user in the last 60 days
61
     *             - opens integer the number of times emails have been opened for this user in the last 60 days
62
     *             - unique_opens integer the number of unique opens for emails sent for this user in the last 60 days
63
     *             - clicks integer the number of URLs that have been clicked for this user in the last 60 days
64
     *             - unique_clicks integer the number of unique clicks for emails sent for this user in the last 60 days
65
     *         - last_90_days struct stats for this user in the last 90 days
66
     *             - sent integer the number of emails sent for this user in the last 90 days
67
     *             - hard_bounces integer the number of emails hard bounced for this user in the last 90 days
68
     *             - soft_bounces integer the number of emails soft bounced for this user in the last 90 days
69
     *             - rejects integer the number of emails rejected for sending this user in the last 90 days
70
     *             - complaints integer the number of spam complaints for this user in the last 90 days
71
     *             - unsubs integer the number of unsubscribes for this user in the last 90 days
72
     *             - opens integer the number of times emails have been opened for this user in the last 90 days
73
     *             - unique_opens integer the number of unique opens for emails sent for this user in the last 90 days
74
     *             - clicks integer the number of URLs that have been clicked for this user in the last 90 days
75
     *             - unique_clicks integer the number of unique clicks for emails sent for this user in the last 90 days
76
     *         - all_time struct stats for the lifetime of the user's account
77
     *             - sent integer the number of emails sent in the lifetime of the user's account
78
     *             - hard_bounces integer the number of emails hard bounced in the lifetime of the user's account
79
     *             - soft_bounces integer the number of emails soft bounced in the lifetime of the user's account
80
     *             - rejects integer the number of emails rejected for sending this user so far today
81
     *             - complaints integer the number of spam complaints in the lifetime of the user's account
82
     *             - unsubs integer the number of unsubscribes in the lifetime of the user's account
83
     *             - opens integer the number of times emails have been opened in the lifetime of the user's account
84
     *             - unique_opens integer the number of unique opens for emails sent in the lifetime of the user's account
85
     *             - clicks integer the number of URLs that have been clicked in the lifetime of the user's account
86
     *             - unique_clicks integer the number of unique clicks for emails sent in the lifetime of the user's account
87
     */
88
    public function info()
89
    {
90
        $_params = array();
91
        return $this->master->call('users/info', $_params);
92
    }
93
94
    /**
95
     * Validate an API key and respond to a ping
96
     * @return string the string "PONG!"
97
     */
98
    public function ping()
99
    {
100
        $_params = array();
101
        return $this->master->call('users/ping', $_params);
102
    }
103
104
    /**
105
     * Validate an API key and respond to a ping (anal JSON parser version)
106
     * @return struct a struct with one key "PING" with a static value "PONG!"
107
     */
108
    public function ping2()
109
    {
110
        $_params = array();
111
        return $this->master->call('users/ping2', $_params);
112
    }
113
114
    /**
115
     * Return the senders that have tried to use this account, both verified and unverified
116
     * @return array an array of sender data, one for each sending addresses used by the account
117
     *     - return[] struct the information on each sending address in the account
118
     *         - address string the sender's email address
119
     *         - created_at string the date and time that the sender was first seen by Mandrill as a UTC date string in YYYY-MM-DD HH:MM:SS format
120
     *         - sent integer the total number of messages sent by this sender
121
     *         - hard_bounces integer the total number of hard bounces by messages by this sender
122
     *         - soft_bounces integer the total number of soft bounces by messages by this sender
123
     *         - rejects integer the total number of rejected messages by this sender
124
     *         - complaints integer the total number of spam complaints received for messages by this sender
125
     *         - unsubs integer the total number of unsubscribe requests received for messages by this sender
126
     *         - opens integer the total number of times messages by this sender have been opened
127
     *         - clicks integer the total number of times tracked URLs in messages by this sender have been clicked
128
     *         - unique_opens integer the number of unique opens for emails sent for this sender
129
     *         - unique_clicks integer the number of unique clicks for emails sent for this sender
130
     */
131
    public function senders()
132
    {
133
        $_params = array();
134
        return $this->master->call('users/senders', $_params);
135
    }
136
}
137