Server   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getUrl() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace FatCode\OpenApi\Annotation;
4
5
use FatCode\Annotation\Target;
6
use FatCode\OpenApi\Annotation\Server\Variable;
7
8
/**
9
 * Server definition.
10
 *
11
 * @Annotation
12
 * @Target(Target::TARGET_ANNOTATION)
13
 */
14
class Server
15
{
16
    /**
17
     * @Required
18
     * @var string
19
     */
20
    public $id;
21
22
    /**
23
     * @var string
24
     */
25
    public $port = '80';
26
27
    /**
28
     * @var string
29
     */
30
    public $host = 'localhost';
31
32
    /**
33
     * An optional string describing the host designated by the URL.
34
     * CommonMark syntax MAY be used for rich text representation.
35
     * @var string
36
     */
37
    public $description;
38
39
    /**
40
     * @var Variable[]
41
     */
42
    public $variables;
43
44
    /**
45
     * A URL to the target host. This URL supports Server Variables and MAY be relative,
46
     * to indicate that the host location is relative to the location where the OpenAPI
47
     * document is being served. Variable substitutions will be made when a variable
48
     * is named in {brackets}.
49
     *
50
     * @var string
51
     */
52
    public $url = 'http://{host}:{port}/';
53
54
    public function getUrl() : string
55
    {
56
        return $this->url;
57
    }
58
}
59