CountPublisher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A broadcastOn() 0 4 1
A name() 0 4 1
A fire() 0 6 1
1
<?php
2
3
namespace SfCod\SocketIoBundle\Tests\Data;
4
5
use SfCod\SocketIoBundle\Events\AbstractEvent;
6
use SfCod\SocketIoBundle\Events\EventInterface;
7
use SfCod\SocketIoBundle\Events\EventPublisherInterface;
8
9
class CountPublisher extends AbstractEvent implements EventInterface, EventPublisherInterface
10
{
11
    /**
12
     * Changel name. For client side this is nsp.
13
     */
14
    public static function broadcastOn(): array
15
    {
16
        return ['notifications'];
17
    }
18
19
    /**
20
     * Event name.
21
     */
22
    public static function name(): string
23
    {
24
        return 'update_notification_count';
25
    }
26
27
    /**
28
     * Emit client event.
29
     */
30
    public function fire(): array
31
    {
32
        return [
33
            'count' => 10,
34
        ];
35
    }
36
}
37