Completed
Push — master ( 6895de...8b3e50 )
by Artem
02:07
created

TopicMessageResponseEvent::getMessageId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the FirebaseCloudMessagingBundle
4
 *
5
 * (c) Artem Genvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Fresh\FirebaseCloudMessagingBundle\Event;
12
13
use Symfony\Component\EventDispatcher\Event;
14
15
/**
16
 * TopicMessageResponseEvent.
17
 *
18
 * @see https://firebase.google.com/docs/cloud-messaging/http-server-ref#table6
19
 *
20
 * @author Artem Genvald <[email protected]>
21
 */
22
class TopicMessageResponseEvent extends Event
23
{
24
    /**
25
     * The topic message ID when FCM has successfully received the request
26
     * and will attempt to deliver to all subscribed devices.
27
     *
28
     * @var int
29
     */
30
    private $messageId;
31
32
    /**
33
     * Error that occurred when processing the message.
34
     *
35
     * @var string
36
     */
37
    private $error;
38
39
    /**
40
     * @param int    $messageId
41
     * @param string $error
42
     */
43
    public function __construct($messageId, $error)
44
    {
45
        $this->messageId = $messageId;
46
        $this->error = $error;
47
    }
48
49
    /**
50
     * @return int
51
     */
52
    public function getMessageId()
53
    {
54
        return $this->messageId;
55
    }
56
57
    /**
58
     * @return string
59
     */
60
    public function getError()
61
    {
62
        return $this->error;
63
    }
64
}
65