Client   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setRequestLauncher() 0 4 1
1
<?php
2
3
namespace Afonso\Emt;
4
5
/**
6
 * The base SDK client for the EMT OpenData API.
7
 *
8
 * @author Carlos Afonso Pérez <[email protected]>
9
 */
10
abstract class Client
11
{
12
    /**
13
     * The base API endpoint.
14
     *
15
     * @var string
16
     */
17
    const ENDPOINT = 'https://openbus.emtmadrid.es:9443';
18
19
    /**
20
     * The request launcher instance.
21
     *
22
     * @var \Afonso\Emt\RequestLauncher
23
     */
24
    protected $launcher;
25
26
    /**
27
     * Create a new Client instance with the given client ID and passkey.
28
     *
29
     * @param string $clientId
30
     * @param string $passkey
31
     */
32 33
    public function __construct($clientId, $passkey)
33
    {
34 33
        $this->launcher = new RequestLauncher($clientId, $passkey);
35 33
    }
36
37
    /**
38
     * Set the RequestLauncher instance to be used by this client.
39
     *
40
     * @param \Afonso\Emt\RequestLauncher $launcher
41
     */
42 33
    public function setRequestLauncher(RequestLauncher $launcher)
43
    {
44 33
        $this->launcher = $launcher;
45 33
    }
46
}
47