| 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|null */ |
||
| 17 | private $serverDoc; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param array $openAPIDoc |
||
| 21 | * @param HttpServerDoc|null $serverDoc |
||
| 22 | */ |
||
| 23 | public function __construct( |
||
| 24 | array $openAPIDoc, |
||
| 25 | HttpServerDoc $serverDoc = null |
||
| 26 | ) { |
||
| 27 | |||
| 28 | $this->openAPIDoc = $openAPIDoc; |
||
| 29 | $this->serverDoc = $serverDoc; |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return HttpServerDoc |
||
| 34 | */ |
||
| 35 | public function getOpenAPIDoc() |
||
| 36 | { |
||
| 37 | return $this->openAPIDoc; |
||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return HttpServerDoc|null |
||
| 42 | */ |
||
| 43 | public function getServerDoc() |
||
| 44 | { |
||
| 45 | return $this->serverDoc; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param array $openAPIDoc |
||
| 50 | * |
||
| 51 | * @return OpenAPIDocCreatedEvent |
||
| 52 | */ |
||
| 53 | public function setOpenAPIDoc(array $openAPIDoc) |
||
| 54 | { |
||
| 55 | $this->openAPIDoc = $openAPIDoc; |
||
| 56 | |||
| 57 | return $this; |
||
| 58 | } |
||
| 59 | } |
||
| 60 |