Passed
Push — master ( b74469...a5e18f )
by Yo
46s queued 11s
created

SwaggerDocCreatedEvent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 47
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setSwaggerDoc() 0 5 1
A getSwaggerDoc() 0 3 1
A __construct() 0 6 1
A getServerDoc() 0 3 1
1
<?php
2
namespace Yoanm\SymfonyJsonRpcHttpServerSwaggerDoc\Event;
3
4
use Yoanm\JsonRpcServerDoc\Domain\Model\HttpServerDoc;
5
use Yoanm\SymfonyJsonRpcHttpServerDoc\Event\DocEvent;
6
7
/**
8
 * Class SwaggerDocCreatedEvent
9
 */
10
class SwaggerDocCreatedEvent extends DocEvent
11
{
12
    const EVENT_NAME = 'json_rpc_http_server_swagger_doc.array_created';
13
14
    /** @var array */
15
    private $swaggerDoc;
16
    /** @var HttpServerDoc|null */
17
    private $serverDoc;
18
19
    /**
20
     * @param array              $swaggerDoc
21
     * @param HttpServerDoc|null $serverDoc
22
     */
23 2
    public function __construct(
24
        array $swaggerDoc,
25
        HttpServerDoc $serverDoc = null
26
    ) {
27 2
        $this->swaggerDoc = $swaggerDoc;
28 2
        $this->serverDoc = $serverDoc;
29 2
    }
30
31
    /**
32
     * @return array
33
     */
34 2
    public function getSwaggerDoc()
35
    {
36 2
        return $this->swaggerDoc;
37
    }
38
39
    /**
40
     * @return HttpServerDoc|null
41
     */
42 1
    public function getServerDoc()
43
    {
44 1
        return $this->serverDoc;
45
    }
46
47
    /**
48
     * @param array $swaggerDoc
49
     *
50
     * @return SwaggerDocCreatedEvent
51
     */
52 1
    public function setSwaggerDoc(array $swaggerDoc)
53
    {
54 1
        $this->swaggerDoc = $swaggerDoc;
55
56 1
        return $this;
57
    }
58
}
59