Completed
Push — master ( cec1cf...f9a404 )
by Javi
03:27
created

ExternalDocumentation::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
ccs 4
cts 4
cp 1
crap 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * Allows referencing an external resource for extended documentation.
7
 *
8
 * @see https://swagger.io/specification/#externalDocumentationObject
9
 */
10
class ExternalDocumentation extends AbstractObject implements ExtensibleInterface
11
{
12
    /**
13
     * REQUIRED. The URL for the target documentation. Value MUST be in the format of a URL.
14
     *
15
     * @var string
16
     */
17
    public $url;
18
19
    /**
20
     * A short description of the target documentation. CommonMark syntax MAY be used for rich text representation.
21
     *
22
     * @var string
23
     */
24
    public $description;
25
26
    /**
27
     * @param string      $url
28
     * @param string|null $description
29
     * @param array       $additionalProperties
30
     */
31 6
    public function __construct(string $url, string $description = null, array $additionalProperties = [])
32
    {
33 6
        parent::__construct($additionalProperties);
34 6
        $this->url         = $url;
35 6
        $this->description = $description;
36 6
    }
37
}
38