Total Complexity | 3 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class HTMLOpenApiRenderer implements OpenApiRendererInterface |
||
9 | { |
||
10 | private const BASE_ASSETS = "https://cdn.jsdelivr.net/gh/eudiegoborgs/natural-swagger-php/src/Resources/assets"; |
||
11 | |||
12 | private \Twig\Environment $twig; |
||
13 | |||
14 | public function __construct() |
||
15 | { |
||
16 | $loader = new FilesystemLoader(dirname(__FILE__) . '/../Resources/Views'); |
||
17 | $this->twig = new \Twig\Environment($loader); |
||
18 | } |
||
19 | |||
20 | public function getFormat(): string |
||
21 | { |
||
22 | return RenderOpenApi::HTML; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @throws \Twig\Error\RuntimeError |
||
27 | * @throws \Twig\Error\SyntaxError |
||
28 | * @throws \Twig\Error\LoaderError |
||
29 | */ |
||
30 | public function render(OpenApi $spec, array $options = []): string |
||
39 | ] |
||
40 | ) |
||
41 | ); |
||
44 |