Completed
Push — master ( 78ef8c...6e8e35 )
by Luke
03:10
created

ListingMethod::getList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace ZpgRtf\Methods;
4
5
use ZpgRtf\Objects\BranchObject;
6
use ZpgRtf\Objects\ListingObject;
7
use ZpgRtf\Objects\ListingDeleteObject;
8
9
/**
10
 * The listing method allows you to list, update or delete listings on the ZPG rtf.
11
 */
12
class ListingMethod extends AbstractMethod
13
{
14
    /** @var string */
15
    const UPDATE_SCHEMA = 'http://realtime-listings.webservices.zpg.co.uk/docs/v1.2/schemas/listing/update.json';
16
17
    /** @var string */
18
    const LIST_SCHEMA = 'http://realtime-listings.webservices.zpg.co.uk/docs/v1.2/schemas/listing/list.json';
19
20
    /** @var string */
21
    const DELETE_SCHEMA = 'http://realtime-listings.webservices.zpg.co.uk/docs/v1.2/schemas/listing/delete.json';
22
23
    /**
24
     * @return \GuzzleHttp\Psr7\Response
25
     */
26 2
    public function getList(BranchObject $branchObject)
27
    {
28 2
        return $this->validateAndSend(self::LIST_SCHEMA, 'listing/list', $branchObject);
29
    }
30
31
    /**
32
     * @return \GuzzleHttp\Psr7\Response
33
     */
34 2
    public function sendUpdate(ListingObject $listingObject)
35
    {
36 2
        return $this->validateAndSend(self::UPDATE_SCHEMA, 'listing/update', $listingObject);
37
    }
38
39
    /**
40
     * @return \GuzzleHttp\Psr7\Response
41
     */
42
    public function sendDelete(ListingDeleteObject $listingDeleteObject)
43
    {
44
        return $this->validateAndSend(self::DELETE_SCHEMA, 'listing/delete', $listingDeleteObject);
45
    }
46
}
47