ServerDocCreatedEvent::getDoc()   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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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