Failed Conditions
Pull Request — release/3.0.0-dev (#32)
by Yo
02:02
created

OnRequestReceivedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 33
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequest() 0 3 1
A getJsonRpcCall() 0 3 1
A __construct() 0 4 1
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Event\Acknowledge;
3
4
use Yoanm\JsonRpcServer\Domain\Event\JsonRpcServerEvent;
5
use Yoanm\JsonRpcServer\Domain\Model\JsonRpcCall;
6
7
/**
8
 * Class OnRequestReceivedEvent
9
 *
10
 * Dispatched when a request has been passed to the endpoint and successfully deserialized
11
 */
12
class OnRequestReceivedEvent implements JsonRpcServerEvent
13
{
14
    const EVENT_NAME = 'json_rpc_server_skd.on_request_received';
15
16
    /** @var string */
17
    private $request;
18
    /** @var JsonRpcCall */
19
    private $jsonRpcCall;
20
21
    /**
22
     * @param string      $request
23
     * @param JsonRpcCall $jsonRpcCall
24
     */
25
    public function __construct(string $request, JsonRpcCall $jsonRpcCall)
26
    {
27
        $this->request = $request;
28
        $this->jsonRpcCall = $jsonRpcCall;
29
    }
30
31
    /**
32
     * @return string
33
     */
34
    public function getRequest() : string
35
    {
36
        return $this->request;
37
    }
38
39
    /**
40
     * @return JsonRpcCall
41
     */
42
    public function getJsonRpcCall() : JsonRpcCall
43
    {
44
        return $this->jsonRpcCall;
45
    }
46
}
47