Test Setup Failed
Push — main ( abdcb9...2e5f68 )
by Slawomir
04:37
created

EventHandlerReference   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getInboundEventClass() 0 3 1
A create() 0 3 1
A getHandlerMethodName() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace App\Infrastructure\Events\Api;
4
5
/**
6
 * Utility class that contains the name of the method that should be called upon an Inbound Event arrival,
7
 * and the class of appropriate Inbound Event.
8
 */
9
class EventHandlerReference
10
{
11
12
    private function __construct(
13
        private string $handlerMethodName,
14
        private string $inboundEventClass
15
    )
16
    {
17
    }
18
19
    /**
20
     * @return string
21
     */
22
    public function getHandlerMethodName(): string
23
    {
24
        return $this->handlerMethodName;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getInboundEventClass(): string
31
    {
32
        return $this->inboundEventClass;
33
    }
34
35
    public static function create(string $handlerMethodName, string $inboundEventClass): EventHandlerReference
36
    {
37
        return new EventHandlerReference($handlerMethodName, $inboundEventClass);
38
    }
39
40
41
}