Reference   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace erasys\OpenApi\Spec\v3;
4
5
/**
6
 * A simple object to allow referencing other components in the specification, internally and externally.
7
 *
8
 * The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules.
9
 *
10
 * For this specification, reference resolution is accomplished as defined by the JSON Reference specification and
11
 * not by the JSON Schema specification.
12
 *
13
 * This object cannot be extended with additional properties and any properties added SHALL be ignored.
14
 *
15
 * @see https://swagger.io/specification/#referenceObject
16
 */
17
class Reference extends AbstractObject
18
{
19
    /**
20
     * REQUIRED. The reference string.
21
     *
22
     * This property SHOULD be renamed to '$ref' when exported.
23
     *
24
     * @var string
25
     */
26
    public $ref;
27
28
    /**
29
     * @param string $ref
30
     */
31 3
    public function __construct(string $ref)
32
    {
33 3
        parent::__construct([]);
34 3
        $this->ref = $ref;
35 3
    }
36
}
37