OnRequestReceivedEvent::getJsonRpcCall()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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