Passed
Push — master ( 0ad48d...150bba )
by Yo
55s queued 11s
created

ServerDocCreatedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A setDoc() 0 5 1
A getDoc() 0 3 1
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServerDoc\Event;
3
4
use Yoanm\JsonRpcServerDoc\Domain\Model\ServerDoc;
5
6
/**
7
 * Class ServerDocCreatedEvent
8
 */
9
class ServerDocCreatedEvent extends DocEvent
10
{
11
    const EVENT_NAME = 'json_rpc_http_server_doc.server_doc_created';
12
13
    /** @var ServerDoc */
14
    private $doc;
15
16
    /**
17
     * @param ServerDoc $doc
18
     */
19 2
    public function __construct(ServerDoc $doc)
20
    {
21 2
        $this->doc = $doc;
22 2
    }
23
24
    /**
25
     * @return ServerDoc
26
     */
27 2
    public function getDoc() : ServerDoc
28
    {
29 2
        return $this->doc;
30
    }
31
32
    /**
33
     * @param ServerDoc $doc
34
     *
35
     * @return ServerDocCreatedEvent
36
     */
37 1
    public function setDoc(ServerDoc $doc) : ServerDocCreatedEvent
38
    {
39 1
        $this->doc = $doc;
40
41 1
        return $this;
42
    }
43
}
44