OpenAPIDocCreatedEvent::getServerDoc()   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\SymfonyJsonRpcHttpServerOpenAPIDoc\Event;
3
4
use Yoanm\JsonRpcServerDoc\Domain\Model\HttpServerDoc;
5
use Yoanm\SymfonyJsonRpcHttpServerDoc\Event\DocEvent;
6
7
/**
8
 * Class OpenAPIDocCreatedEvent
9
 */
10
class OpenAPIDocCreatedEvent extends DocEvent
11
{
12
    const EVENT_NAME = 'json_rpc_http_server_openapi_doc.array_created';
13
14
    /** @var array */
15
    private $openAPIDoc;
16
    /** @var HttpServerDoc */
17
    private $serverDoc;
18
19
    /**
20
     * @param array         $openAPIDoc
21
     * @param HttpServerDoc $serverDoc
22
     */
23 2
    public function __construct(array $openAPIDoc, HttpServerDoc $serverDoc)
24
    {
25
26 2
        $this->openAPIDoc = $openAPIDoc;
27 2
        $this->serverDoc = $serverDoc;
28 2
    }
29
30
    /**
31
     * @return array
32
     */
33 2
    public function getOpenAPIDoc() : array
34
    {
35 2
        return $this->openAPIDoc;
36
    }
37
38
    /**
39
     * @return HttpServerDoc
40
     */
41 1
    public function getServerDoc() : HttpServerDoc
42
    {
43 1
        return $this->serverDoc;
44
    }
45
46
    /**
47
     * @param array $openAPIDoc
48
     *
49
     * @return OpenAPIDocCreatedEvent
50
     */
51 1
    public function setOpenAPIDoc(array $openAPIDoc) : OpenAPIDocCreatedEvent
52
    {
53 1
        $this->openAPIDoc = $openAPIDoc;
54
55 1
        return $this;
56
    }
57
}
58