Passed
Pull Request — master (#3)
by Gombos
02:15
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 accounts() 0 3 1
A subscribers() 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
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