ListenerAbstract   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 2
c 1
b 0
f 0
dl 0
loc 21
ccs 2
cts 2
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A publish() 0 2 1
A hash() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Nymfonya\Component\Pubsub;
6
7
abstract class ListenerAbstract implements ListenerInterface
8
{
9
    /**
10
     * publish
11
     *
12
     * @param EventInterface $event
13
     * @return void
14
     */
15
    public function publish(EventInterface $event)
16
    {
17
        // do nothing
18
    }
19
20
    /**
21
     * return listener hash string
22
     *
23
     * @return string
24
     */
25 1
    public function hash(): string
26
    {
27 1
        return spl_object_hash($this);
28
    }
29
}
30