EventCorrelation::create()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
nc 1
nop 3
dl 0
loc 6
c 1
b 0
f 0
cc 1
rs 10
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