ExtensionProperty::getValue()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 0
dl 0
loc 3
c 0
b 0
f 0
cc 1
rs 10
ccs 2
cts 2
cp 1
crap 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