Passed
Pull Request — master (#3)
by Gombos
02:15
created

Drip::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
use Glorand\Drip\ClientManager;
9
10
class Drip extends ClientManager
11
{
12
    /** @var string */
13
    protected $accountId;
14
15
    /**
16
     * Drip constructor.
17
     *
18
     * @param string $accountId
19
     * @param string $apiToken
20
     * @param string $userAgent
21
     */
22
    public function __construct(string $accountId, string $apiToken, string $userAgent)
23
    {
24
        parent::__construct($apiToken, $userAgent);
25
        $this->accountId = $accountId;
26
    }
27
28
    /**
29
     * @return Events
30
     */
31
    public function events(): Events
32
    {
33
        return new Events($this->getClient(), $this->accountId);
34
    }
35
36
    /**
37
     * @return Subscribers
38
     */
39
    public function subscribers(): Subscribers
40
    {
41
        return new Subscribers($this->getClient(), $this->accountId);
42
    }
43
44
    /**
45
     * @return Accounts
46
     */
47
    public function accounts(): Accounts
48
    {
49
        return new Accounts($this->getClient(), $this->accountId);
50
    }
51
}
52