Completed
Push — master ( 92ccbf...b2415b )
by Simonas
63:39
created

MessageUpdateListener::onMessageUpdate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace ONGR\TranslationsBundle\EventListener;
4
5
use ONGR\TranslationsBundle\Event\MessageUpdateEvent;
6
use ONGR\TranslationsBundle\Service\HistoryManager;
7
8
class MessageUpdateListener
9
{
10
    /**
11
     * @var HistoryManager
12
     */
13
    private $historyManager;
14
15
    /**
16
     * @param HistoryManager $historyManager
17
     */
18
    public function __construct(HistoryManager $historyManager)
19
    {
20
        $this->historyManager = $historyManager;
21
    }
22
23
    public function onMessageUpdate(MessageUpdateEvent $e)
24
    {
25
        $this->historyManager->add($e->getMessage(), $e->getDocument());
26
    }
27
}
28