BaseClass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

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 Concerns\UrlTransformer,
10
        Concerns\InputChecker;
11
12
    /** @var \GuzzleHttp\Client */
13
    protected $client;
14
15
    /** @var Headers */
16
    protected $headers;
17
18
    /** @var string The environment this is being run in */
19
    protected $environment;
20
21
    /**
22
     * Instantiate the class.
23
     *
24
     * @param Client  $client
25
     * @param Headers $headers
26
     * @param string  $environment
27
     */
28 78
    public function __construct(Client $client, Headers $headers, $environment = null)
29
    {
30 78
        $this->client = $client;
31 78
        $this->headers = $headers;
32 78
        $this->environment = $environment;
33 78
    }
34
35
    /**
36
     * Get the base URL. This handles the correct
37
     * url generation based on production and
38
     * test environment.
39
     *
40
     * @return string
41
     */
42 78
    public function getBaseUrl()
43
    {
44 78
        return $this->transformUrl(static::URI);
45
    }
46
}
47