Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
10 | class MethodDocCreatedEvent extends DocEvent |
||
11 | { |
||
12 | const EVENT_NAME = 'json_rpc_http_server_doc.method_doc_created'; |
||
13 | |||
14 | /** @var MethodDoc */ |
||
15 | private $doc; |
||
16 | /** @var JsonRpcMethodInterface|null */ |
||
17 | private $method; |
||
18 | |||
19 | /** |
||
20 | * @param MethodDoc $doc |
||
21 | */ |
||
22 | 3 | public function __construct(MethodDoc $doc) |
|
23 | { |
||
24 | 3 | $this->doc = $doc; |
|
25 | 3 | } |
|
26 | |||
27 | /** |
||
28 | * @return MethodDoc |
||
29 | */ |
||
30 | 2 | public function getDoc() : MethodDoc |
|
31 | { |
||
32 | 2 | return $this->doc; |
|
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return null|JsonRpcMethodInterface |
||
37 | */ |
||
38 | 2 | public function getMethod() : ?JsonRpcMethodInterface |
|
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param JsonRpcMethodInterface $method |
||
45 | * |
||
46 | * @return MethodDocCreatedEvent |
||
47 | */ |
||
48 | 1 | public function setMethod(JsonRpcMethodInterface $method) : MethodDocCreatedEvent |
|
49 | { |
||
50 | 1 | $this->method = $method; |
|
51 | |||
52 | 1 | return $this; |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @param MethodDoc $doc |
||
57 | * |
||
58 | * @return MethodDocCreatedEvent |
||
59 | */ |
||
60 | 1 | public function setDoc(MethodDoc $doc) : MethodDocCreatedEvent |
|
65 | } |
||
66 | } |
||
67 |