Passed
Pull Request — master (#3)
by Gombos
01:57
created

Drip   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 40
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A events() 0 3 1
A subscribers() 0 3 1
A accounts() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Glorand\Drip;
4
5
use Glorand\Drip\Api\Accounts;
6
use Glorand\Drip\Api\Events;
7
use Glorand\Drip\Api\Subscribers;
8
9
class Drip extends ClientManager
10
{
11
    /** @var string */
12
    protected $accountId;
13
14
    /**
15
     * Drip constructor.
16
     *
17
     * @param string $accountId
18
     * @param string $apiToken
19
     * @param string $userAgent
20
     */
21
    public function __construct(string $accountId, string $apiToken, string $userAgent)
22
    {
23
        parent::__construct($apiToken, $userAgent);
24
        $this->accountId = $accountId;
25
    }
26
27
    /**
28
     * @return Events
29
     */
30
    public function events(): Events
31
    {
32
        return new Events($this->getClient(), $this->accountId);
33
    }
34
35
    /**
36
     * @return Subscribers
37
     */
38
    public function subscribers(): Subscribers
39
    {
40
        return new Subscribers($this->getClient(), $this->accountId);
41
    }
42
43
    /**
44
     * @return Accounts
45
     */
46
    public function accounts(): Accounts
47
    {
48
        return new Accounts($this->getClient(), $this->accountId);
49
    }
50
}
51