Drip   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 40
ccs 10
cts 10
cp 1
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 9
    public function __construct(string $accountId, string $apiToken, string $userAgent = 'DripPHP Agent')
22
    {
23 9
        parent::__construct($apiToken, $userAgent);
24 9
        $this->accountId = $accountId;
25 9
    }
26
27
    /**
28
     * @return \Glorand\Drip\Api\Events
29
     */
30 4
    public function events(): Events
31
    {
32 4
        return new Events($this->getClient(), $this->accountId);
33
    }
34
35
    /**
36
     * @return \Glorand\Drip\Api\Subscribers
37
     */
38 4
    public function subscribers(): Subscribers
39
    {
40 4
        return new Subscribers($this->getClient(), $this->accountId);
41
    }
42
43
    /**
44
     * @return \Glorand\Drip\Api\Accounts
45
     */
46 2
    public function accounts(): Accounts
47
    {
48 2
        return new Accounts($this->getClient(), $this->accountId);
49
    }
50
}
51