ObservableEventAbstract   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 4 1
1
<?php
2
3
namespace RemotelyLiving\PHPDNS\Observability\Events;
4
5
use JsonSerializable;
6
use RemotelyLiving\PHPDNS\Entities\Interfaces\Arrayable;
7
use Symfony\Component\EventDispatcher\GenericEvent;
8
9
abstract class ObservableEventAbstract extends GenericEvent implements
10
    JsonSerializable,
11
    Arrayable
12
{
13
    abstract public static function getName(): string;
14
15
    public function jsonSerialize(): array
16
    {
17
        return [
18
            $this::getName() => $this->toArray(),
19
        ];
20
    }
21
}
22