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

AbstractOnMethodEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getJsonRpcRequest() 0 3 1
A getMethod() 0 3 1
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Event\Action;
3
4
use Yoanm\JsonRpcServer\Domain\Event\JsonRpcServerEvent;
5
use Yoanm\JsonRpcServer\Domain\JsonRpcMethodInterface;
6
use Yoanm\JsonRpcServer\Domain\Model\JsonRpcRequest;
7
8
/**
9
 * Class AbstractOnMethodEvent
10
 */
11
abstract class AbstractOnMethodEvent implements JsonRpcServerEvent
12
{
13
    /** @var JsonRpcRequest */
14
    private $jsonRpcRequest;
15
    /** @var JsonRpcMethodInterface */
16
    private $method;
17
18
    /**
19
     * @param JsonRpcMethodInterface $method
20
     * @param JsonRpcRequest|null    $jsonRpcRequest
21
     */
22
    public function __construct(JsonRpcMethodInterface $method, JsonRpcRequest $jsonRpcRequest)
23
    {
24
        $this->jsonRpcRequest = $jsonRpcRequest;
25
        $this->method = $method;
26
    }
27
28
    /**
29
     * @return JsonRpcRequest
30
     */
31
    public function getJsonRpcRequest() : JsonRpcRequest
32
    {
33
        return $this->jsonRpcRequest;
34
    }
35
36
    /**
37
     * @return JsonRpcMethodInterface
38
     */
39
    public function getMethod() : JsonRpcMethodInterface
40
    {
41
        return $this->method;
42
    }
43
}
44