Passed
Push — master ( 018c73...c49cf5 )
by Bence
03:29
created

Helper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 19
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
3
namespace WrapIt\Helpers;
4
5
use WrapIt\WrapIt;
6
use WrapIt\Exceptions\WrapItParameterException;
7
use WrapIt\Exceptions\WrapItResponseException;
8
use WrapIt\Http\WrapItApiRequester;
9
10
/**
11
 * Class Helper
12
 *
13
 * @package WrapIt
14
 */
15
abstract class Helper {
16
17
    protected $client_id = null;
18
    protected $client_secret = null;
19
    protected $domain = null;
20
21
    protected $api_requester;
22
23 30
    public function __construct($wi) {
24 30
        if (!($wi instanceof WrapIt)) {
25
            throw new WrapItParameterException("WrapIt class required");
26
        }
27
28 30
        $this->client_id = $wi->getClientId();
29 30
        $this->client_secret = $wi->getClientSecret();
30 30
        $this->domain = $wi->getDomain();
31 30
        $this->api_requester = new WrapItApiRequester($wi->getDomain());
32 30
    }
33
}
34