AbstractSubscriptionListener   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 0
dl 0
loc 51
ccs 0
cts 10
cp 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
onSubscriptionCreated() 0 1 ?
onSubscriptionChanged() 0 1 ?
onSubscriptionCanceled() 0 1 ?
onSubscriptionClosed() 0 1 ?
onSubscriptionReactivated() 0 1 ?
A getSubscribedEvents() 0 10 1
1
<?php
2
3
namespace Speicher210\FastbillBundle\EventListener;
4
5
use Speicher210\FastbillBundle\Event\SubscriptionCanceledEvent;
6
use Speicher210\FastbillBundle\Event\SubscriptionChangedEvent;
7
use Speicher210\FastbillBundle\Event\SubscriptionClosedEvent;
8
use Speicher210\FastbillBundle\Event\SubscriptionCreatedEvent;
9
use Speicher210\FastbillBundle\Event\SubscriptionReactivatedEvent;
10
use Speicher210\FastbillBundle\FastbillNotificationEvents;
11
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
12
13
/**
14
 * Event listener for incoming Fastbill subscription notifications.
15
 */
16
abstract class AbstractSubscriptionListener implements EventSubscriberInterface
17
{
18
    /**
19
     * Handle creating a subscription.
20
     *
21
     * @param SubscriptionCreatedEvent $event The raised event.
22
     */
23
    abstract public function onSubscriptionCreated(SubscriptionCreatedEvent $event);
24
25
    /**
26
     * Handle changing a subscription.
27
     *
28
     * @param SubscriptionChangedEvent $event The raised event.
29
     */
30
    abstract public function onSubscriptionChanged(SubscriptionChangedEvent $event);
31
32
    /**
33
     * Handle canceling a subscription.
34
     *
35
     * @param SubscriptionCanceledEvent $event The raised event.
36
     */
37
    abstract public function onSubscriptionCanceled(SubscriptionCanceledEvent $event);
38
39
    /**
40
     * Handle closing a subscription.
41
     *
42
     * @param SubscriptionClosedEvent $event The raised event.
43
     */
44
    abstract public function onSubscriptionClosed(SubscriptionClosedEvent $event);
45
46
    /**
47
     * Handle reactivating a subscription.
48
     *
49
     * @param SubscriptionReactivatedEvent $event The raised event.
50
     */
51
    abstract public function onSubscriptionReactivated(SubscriptionReactivatedEvent $event);
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public static function getSubscribedEvents()
57
    {
58
        return array(
59
            FastbillNotificationEvents::INCOMING_SUBSCRIPTION_CREATED => 'onSubscriptionCreated',
60
            FastbillNotificationEvents::INCOMING_SUBSCRIPTION_CHANGED => 'onSubscriptionChanged',
61
            FastbillNotificationEvents::INCOMING_SUBSCRIPTION_CANCELED => 'onSubscriptionCanceled',
62
            FastbillNotificationEvents::INCOMING_SUBSCRIPTION_CLOSED => 'onSubscriptionClosed',
63
            FastbillNotificationEvents::INCOMING_SUBSCRIPTION_REACTIVATED => 'onSubscriptionReactivated'
64
        );
65
    }
66
}
67