BaseClass::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 3
dl 0
loc 6
ccs 5
cts 5
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
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