Completed
Push — master ( 722808...ad4a08 )
by Saurabh
08:30
created

BaseClass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getBaseUrl() 0 4 1
1
<?php
2
3
namespace Sausin\Signere;
4
5
use GuzzleHttp\Client;
6
7
abstract class BaseClass
8
{
9
    use UrlTransformer;
10
11
    /** @var \GuzzleHttp\Client */
12
    protected $client;
13
14
    /** @var Headers */
15
    protected $headers;
16
17
    /** @var string The environment this is being run in */
18
    protected $environment;
19
20
    /**
21
     * Instantiate the class.
22
     *
23
     * @param Client  $client
24
     * @param Headers $headers
25
     * @param string  $environment
26
     */
27 78
    public function __construct(Client $client, Headers $headers, $environment = null)
28
    {
29 78
        $this->client = $client;
30 78
        $this->headers = $headers;
31 78
        $this->environment = $environment;
32 78
    }
33
34
    /**
35
     * Get the base URL. This handles the correct
36
     * url generation based on production and
37
     * test environment.
38
     *
39
     * @return string
40
     */
41 78
    public function getBaseUrl()
42
    {
43 78
        return $this->transformUrl(static::URI);
44
    }
45
}
46