Completed
Push — master ( 8e0ded...b5dffc )
by Romain
10s
created

BroadcastResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBroadcastId() 0 3 1
A parseResponse() 0 4 1
A getMessageCreativeId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Kerox\Messenger\Response;
6
7
class BroadcastResponse extends AbstractResponse
8
{
9
    private const MESSAGE_CREATIVE_ID = 'message_creative_id';
10
    private const BROADCAST_ID = 'broadcast_id';
11
12
    /**
13
     * @var null|string
14
     */
15
    protected $messageCreativeId;
16
17
    /**
18
     * @var null|string
19
     */
20
    protected $broadcastId;
21
22
    /**
23
     * @param array $response
24
     */
25
    protected function parseResponse(array $response): void
26
    {
27
        $this->messageCreativeId = $response[self::MESSAGE_CREATIVE_ID] ?? null;
28
        $this->broadcastId = $response[self::BROADCAST_ID] ?? null;
29
    }
30
31
    /**
32
     * @return null|string
33
     */
34
    public function getMessageCreativeId(): ?string
35
    {
36
        return $this->messageCreativeId;
37
    }
38
39
    /**
40
     * @return null|string
41
     */
42
    public function getBroadcastId(): ?string
43
    {
44
        return $this->broadcastId;
45
    }
46
}
47