Server   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * An object representing a Server.
7
 *
8
 * @see https://swagger.io/specification/#serverObject
9
 */
10
class Server extends AbstractObject implements ExtensibleInterface
11
{
12
    /**
13
     * REQUIRED. A URL to the target host.
14
     * This URL supports Server Variables and MAY be relative,
15
     * to indicate that the host location is relative to the location where the OpenAPI document is being served.
16
     * Variable substitutions will be made when a variable is named in {brackets}.
17
     *
18
     * @var string
19
     */
20
    public $url;
21
22
    /**
23
     * An optional string describing the host designated by the URL.
24
     * CommonMark syntax MAY be used for rich text representation.
25
     *
26
     * @var string
27
     */
28
    public $description;
29
30
    /**
31
     * A map between a variable name and its value. The value is used for substitution in the server's URL template.
32
     *
33
     * @var ServerVariable[] array<string, ServerVariable>
34
     */
35
    public $variables;
36
37
    /**
38
     * @param string      $url
39
     * @param string|null $description
40
     * @param array|null  $variables
41
     * @param array       $additionalProperties
42
     */
43 6
    public function __construct(
44
        string $url,
45
        string $description = null,
46
        array $variables = null,
47
        array $additionalProperties = []
48
    ) {
49 6
        parent::__construct($additionalProperties);
50 6
        $this->url         = $url;
51 6
        $this->description = $description;
52 6
        $this->variables   = $variables;
53 6
    }
54
}
55