ExtensionProperty   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getName() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace erasys\OpenApi;
4
5
/**
6
 * Specification Extension property definition.
7
 */
8
class ExtensionProperty
9
{
10
    /**
11
     * Exact name of the property that will be used in the generated schema.
12
     *
13
     * @var string
14
     */
15
    private $name;
16
17
    /**
18
     * Value of the property
19
     *
20
     * @var mixed
21
     */
22
    private $value;
23
24
    /**
25
     * @param string     $name Extension property name without the 'x-' prefix.
26
     * @param mixed|null $value
27
     */
28 3
    public function __construct(string $name, $value = null)
29
    {
30 3
        $this->name  = 'x-' . $name;
31 3
        $this->value = $value;
32 3
    }
33
34
    /**
35
     * @return string
36
     */
37 3
    public function getName(): string
38
    {
39 3
        return $this->name;
40
    }
41
42
    /**
43
     * @return mixed
44
     */
45 3
    public function getValue()
46
    {
47 3
        return $this->value;
48
    }
49
}
50