SwaggerDocCreatedEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 47
ccs 10
cts 10
cp 1
rs 10
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 4
    public function __construct(
24
        array $swaggerDoc,
25
        HttpServerDoc $serverDoc = null
26
    ) {
27 4
        $this->swaggerDoc = $swaggerDoc;
28 4
        $this->serverDoc = $serverDoc;
29
    }
30
31
    /**
32
     * @return array
33
     */
34 4
    public function getSwaggerDoc()
35
    {
36 4
        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 2
    public function setSwaggerDoc(array $swaggerDoc)
53
    {
54 2
        $this->swaggerDoc = $swaggerDoc;
55
56 2
        return $this;
57
    }
58
}
59