SwaggerConfiguration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 25
ccs 1
cts 1
cp 1
rs 10
c 2
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
/**
4
 * It's free open-source software released under the MIT License.
5
 *
6
 * @author Anatoly Nekhay <[email protected]>
7
 * @copyright Copyright (c) 2018, Anatoly Nekhay
8
 * @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
9
 * @link https://github.com/sunrise-php/http-router
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sunrise\Http\Router\OpenApi;
15
16
use Sunrise\Http\Router\OpenApi\Controller\OpenApiController;
17
18
/**
19
 * @since 3.0.0
20
 */
21
final class SwaggerConfiguration
22
{
23
    public const DEFAULT_TEMPLATE_FILENAME = __DIR__ . '/../../resources/templates/swagger.phtml';
24
25
    public const DEFAULT_CSS_URLS = [
26
        'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.18.2/swagger-ui.min.css',
27
    ];
28
29
    public const DEFAULT_JS_URLS = [
30
        'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.18.2/swagger-ui-bundle.min.js',
31
        'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.18.2/swagger-ui-standalone-preset.min.js',
32
    ];
33
34
    public const DEFAULT_OPENAPI_URI = OpenApiController::ROUTE_PATH;
35
36 1
    public function __construct(
37
        public readonly string $templateFilename = self::DEFAULT_TEMPLATE_FILENAME,
38
        /** @var array<array-key, string> */
39
        public readonly array $cssUrls = self::DEFAULT_CSS_URLS,
40
        /** @var array<array-key, string> */
41
        public readonly array $jsUrls = self::DEFAULT_JS_URLS,
42
        public readonly string $openapiUri = self::DEFAULT_OPENAPI_URI,
43
        /** @var array<string, mixed> */
44
        public readonly array $templateVariables = [],
45
    ) {
46 1
    }
47
}
48