Completed
Push — master ( 58dd05...6b6b52 )
by Carlos
01:57
created

Client::setRequestLauncher()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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 24
    public function __construct($clientId, $passkey)
33
    {
34 24
        $this->launcher = new RequestLauncher($clientId, $passkey);
35 24
    }
36
37
    /**
38
     * Set the RequestLauncher instance to be used by this client.
39
     *
40
     * @param \Afonso\Emt\RequestLauncher $launcher
41
     */
42 24
    public function setRequestLauncher(RequestLauncher $launcher)
43
    {
44 24
        $this->launcher = $launcher;
45 24
    }
46
}
47