MessageUpdateListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onMessageUpdate() 0 4 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());
0 ignored issues
show
Bug introduced by
The method add() does not seem to exist on object<ONGR\Translations...Service\HistoryManager>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
26
    }
27
}
28