DeliveryReportCallbackEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setDeliveryReportCallback() 0 3 1
A getDeliveryReportCallback() 0 2 1
1
<?php
2
3
/*
4
 * This file is part of the smsmode-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\SmsModeBundle\Event;
13
14
use WBW\Bundle\CoreBundle\Event\AbstractEvent as BaseEvent;
15
use WBW\Library\SmsMode\Model\DeliveryReportCallback;
16
17
/**
18
 * Delivery report callback event.
19
 *
20
 * @author webeweb <https://github.com/webeweb>
21
 * @package WBW\Bundle\SmsModeBundle\Event
22
 */
23
class DeliveryReportCallbackEvent extends BaseEvent {
24
25
    /**
26
     * Event name.
27
     *
28
     * @var string
29
     */
30
    const EVENT_NAME = "wbw.smsmode.event.delivery_report_callback";
31
32
    /**
33
     * Delivery report.
34
     *
35
     * @var DeliveryReportCallback
36
     */
37
    private $deliveryReportCallback;
38
39
    /**
40
     * Constructor.
41
     *
42
     * @param DeliveryReportCallback $deliveryReportCallback The delivery report.
43
     */
44
    public function __construct(DeliveryReportCallback $deliveryReportCallback) {
45
        parent::__construct(self::EVENT_NAME);
46
47
        $this->setDeliveryReportCallback($deliveryReportCallback);
48
    }
49
50
    /**
51
     * Get the delivery report.
52
     *
53
     * @return DeliveryReportCallback Returns the delivery report.
54
     */
55
    public function getDeliveryReportCallback(): DeliveryReportCallback {
56
        return $this->deliveryReportCallback;
57
    }
58
59
    /**
60
     * Set the delivery report.
61
     *
62
     * @param DeliveryReportCallback $deliveryReportCallback The delivery report.
63
     * @return DeliveryReportCallbackEvent Returns this delivery report callback event.
64
     */
65
    protected function setDeliveryReportCallback(DeliveryReportCallback $deliveryReportCallback): DeliveryReportCallbackEvent {
66
        $this->deliveryReportCallback = $deliveryReportCallback;
67
        return $this;
68
    }
69
}
70