ListingDeleteObject   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 58
ccs 14
cts 14
cp 1
rs 10
c 1
b 0
f 1
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setDeletionReason() 0 5 1
A setListingReference() 0 5 1
A getListingReference() 0 3 1
A jsonSerialize() 0 5 1
A getDeletionReason() 0 3 1
1
<?php
2
3
namespace ZpgRtf\Objects;
4
5
/**
6
 * The listing delete object allows you to remove a listing from a branch's inventory list.
7
 */
8
class ListingDeleteObject implements \JsonSerializable
9
{
10
    /** @var null|string */
11
    private $listingReference;
12
13
    /**
14
     * Enum (withdrawn, offer_accepted, exchanged, completed, let)
15
     *
16
     * @var null|string
17
     */
18
    private $deletionReason;
19
20
    /**
21
     * @return null|string
22
     */
23 4
    public function getListingReference()
24
    {
25 4
        return $this->listingReference;
26
    }
27
28
    /**
29
     * @param string $listingReference
30
     *
31
     * @return ListingDeleteObject
32
     */
33 2
    public function setListingReference(string $listingReference): self
34
    {
35 2
        $this->listingReference = $listingReference;
36
37 2
        return $this;
38
    }
39
40
    /**
41
     * @return null|string
42
     */
43 4
    public function getDeletionReason()
44
    {
45 4
        return $this->deletionReason;
46
    }
47
48
    /**
49
     * @param string $deletionReason
50
     *
51
     * @return ListingDeleteObject
52
     */
53 2
    public function setDeletionReason(string $deletionReason): self
54
    {
55 2
        $this->deletionReason = $deletionReason;
56
57 2
        return $this;
58
    }
59
60
    /** {@inheritDoc} */
61 3
    public function jsonSerialize(): array
62
    {
63 3
        return array_filter([
64 3
            'listing_reference' => $this->getListingReference(),
65 3
            'deletion_reason' => $this->getDeletionReason(),
66
        ]);
67
    }
68
}
69