Completed
Push — master ( c6d869...2df250 )
by Luke
01:23
created

AbstractMethod::setClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace ZpgRtf\Methods;
4
5
use GuzzleHttp\Client;
6
7
/**
8
 * The listing method allows you to list, update or delete listings on the ZPG rtf.
9
 */
10
abstract class AbstractMethod
11
{
12
    /** @var string */
13
    const BASE_URI = 'https://realtime-listings-api.webservices.zpg.co.uk/sandbox/v1/';
14
15
    /** @var Client */
16
    private $client;
17
18
    /**
19
     * @param string $certificate
20
     */
21 2
    public function __construct($certificate)
22
    {
23 2
        $this->client = new Client([
24 2
            'base_uri' => self::BASE_URI,
25 2
            'cert' => $certificate,
26
        ]);
27 2
    }
28
29
    /**
30
     * @return Client
31
     */
32 1
    public function getClient()
33
    {
34 1
        return $this->client;
35
    }
36
37
    /**
38
     * @param Client $client
39
     *
40
     * @return static
41
     */
42 2
    public function setClient(Client $client)
43
    {
44 2
        $this->client = $client;
45
46 2
        return $this;
47
    }
48
}
49