Completed
Push — master ( dd8539...4b6ec1 )
by Tobias
04:14
created

WhenPongWriteLog::notify()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 10
loc 10
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 6
1
<?php
2
3
namespace Happyr\SimpleBusBundle\Message\EventSubscriber;
4
5
use Psr\Log\LoggerInterface;
6
use Happyr\SimpleBusBundle\Message\Event\Pong;
7
8 View Code Duplication
class WhenPongWriteLog
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @var LoggerInterface
12
     */
13
    private $logger;
14
15
    /**
16
     * @param LoggerInterface $logger
17
     */
18
    public function __construct(LoggerInterface $logger = null)
19
    {
20
        $this->logger = $logger;
21
    }
22
23
    public function notify(Pong $event)
24
    {
25
        $data = $event->getData();
26
27
        if ($this->logger !== null) {
28
            $this->logger->error('Pong event subscriber works!', ['data' => $data]);
29
        }
30
31
        return;
32
    }
33
}
34