OnRequestReceivedEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 33
ccs 7
cts 7
cp 1
rs 10
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 25
    public function __construct(string $request, JsonRpcCall $jsonRpcCall)
26
    {
27 25
        $this->request = $request;
28 25
        $this->jsonRpcCall = $jsonRpcCall;
29
    }
30
31
    /**
32
     * @return string
33
     */
34 1
    public function getRequest() : string
35
    {
36 1
        return $this->request;
37
    }
38
39
    /**
40
     * @return JsonRpcCall
41
     */
42 1
    public function getJsonRpcCall() : JsonRpcCall
43
    {
44 1
        return $this->jsonRpcCall;
45
    }
46
}
47