Passed
Push — master ( 3db25e...88be9e )
by Alexey
03:31
created

UserSubscribersUpdatedListener   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onAppUserSubscribersUpdated() 0 4 1
1
<?php
2
3
namespace Skobkin\Bundle\PointToolsBundle\EventListener;
4
5
use Skobkin\Bundle\PointToolsBundle\Event\UserSubscribersUpdatedEvent;
6
use Skobkin\Bundle\PointToolsBundle\Service\Telegram\Notifier;
7
8
class UserSubscribersUpdatedListener
9
{
10
    /**
11
     * @var Notifier
12
     */
13
    private $notifier;
14
15
16
    /**
17
     * UsersRenameNotifierListener constructor.
18
     *
19
     * @param Notifier $notifier
20
     */
21
    public function __construct(Notifier $notifier)
22
    {
23
        $this->notifier = $notifier;
24
    }
25
26
    public function onAppUserSubscribersUpdated(UserSubscribersUpdatedEvent $event)
27
    {
28
        $this->notifier->sendUserSubscribersUpdatedNotification($event->getUser(), $event->getSubscribedUsers(), $event->getUnsubscribedUsers());
29
    }
30
}