Completed
Push — master ( 935a4f...80b369 )
by Veaceslav
01:53
created

Reference   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getHref() 0 4 1
A jsonSerialize() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Aweapi\Openapi\Objects;
6
7
use Aweapi\Openapi\Definition;
8
9
final class Reference implements
10
    Definition,
11
    SchemaAggregate,
12
    ResponseAggregate,
13
    ParameterAggregate,
14
    RequestBodyAggregate,
15
    HeaderAggregate,
16
    SecuritySchemeAggregate,
17
    ExampleAggregate,
18
    LinkAggregate
19
{
20
    private $href;
21
22 11
    public function __construct(string $href)
23
    {
24 11
        $this->href = $href;
25
    }
26
27 10
    public function getHref(): string
28
    {
29 10
        return $this->href;
30
    }
31
32 10
    public function jsonSerialize(): ?array
33
    {
34
        return [
35 10
            '$ref' => $this->getHref(),
36
        ];
37
    }
38
}
39