AbstractCustomerListener   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
onCustomerCreated() 0 1 ?
onCustomerChanged() 0 1 ?
onCustomerDeleted() 0 1 ?
A getSubscribedEvents() 0 8 1
1
<?php
2
3
namespace Speicher210\FastbillBundle\EventListener;
4
5
use Speicher210\FastbillBundle\Event\CustomerChangedEvent;
6
use Speicher210\FastbillBundle\Event\CustomerCreatedEvent;
7
use Speicher210\FastbillBundle\Event\CustomerDeletedEvent;
8
use Speicher210\FastbillBundle\FastbillNotificationEvents;
9
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
10
11
/**
12
 * Event listener for incoming Fastbill customer notifications.
13
 */
14
abstract class AbstractCustomerListener implements EventSubscriberInterface
15
{
16
17
    /**
18
     * Handle creating a customer.
19
     *
20
     * @param CustomerCreatedEvent $event The raised event.
21
     */
22
    abstract public function onCustomerCreated(CustomerCreatedEvent $event);
23
24
    /**
25
     * Handle changing a customer.
26
     *
27
     * @param CustomerChangedEvent $event The raised event.
28
     */
29
    abstract public function onCustomerChanged(CustomerChangedEvent $event);
30
31
    /**
32
     * Handle deleting a customer.
33
     *
34
     * @param CustomerDeletedEvent $event The raised event.
35
     */
36
    abstract public function onCustomerDeleted(CustomerDeletedEvent $event);
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public static function getSubscribedEvents()
42
    {
43
        return array(
44
            FastbillNotificationEvents::INCOMING_CUSTOMER_CREATED => 'onCustomerCreated',
45
            FastbillNotificationEvents::INCOMING_CUSTOMER_CHANGED => 'onCustomerChanged',
46
            FastbillNotificationEvents::INCOMING_CUSTOMER_DELETED => 'onCustomerDeleted'
47
        );
48
    }
49
}
50