EventCorrelation   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A __construct() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Th3Mouk\ReactiveEventDispatcher;
6
7
/**
8
 * @psalm-immutable
9
 */
10
final class EventCorrelation
11
{
12
    /** @psalm-var class-string */
13
    public string $eventFqcn;
14
    /** @psalm-var class-string */
15
    public string $listenerFqcn;
16
    public Priority $priority;
17
18
    /**
19
     * @psalm-param class-string $eventFqcn
20
     * @psalm-param class-string $listenerFqcn
21
     */
22
    private function __construct(
23
        string $eventFqcn,
24
        string $listenerFqcn,
25
        Priority $priority
26
    ) {
27
        $this->eventFqcn    = $eventFqcn;
28
        $this->listenerFqcn = $listenerFqcn;
29
        $this->priority     = $priority;
30
    }
31
32
    /**
33
     * @psalm-param class-string $eventFqcn
34
     * @psalm-param class-string $listenerFqcn
35
     */
36
    public static function create(
37
        string $eventFqcn,
38
        string $listenerFqcn,
39
        Priority $priority
40
    ): self {
41
        return new self($eventFqcn, $listenerFqcn, $priority);
42
    }
43
}
44