Parameter::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
3
4
namespace Apie\OpenapiSchema\Spec;
5
6
use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension;
7
use Apie\OpenapiSchema\Contract\SchemaContract;
8
use Apie\OpenapiSchema\Map\ExampleMap;
9
use Apie\OpenapiSchema\ValueObjects\ParameterIn;
10
use Apie\ValueObjects\ValueObjectInterface;
11
12
/**
13
 * @see https://swagger.io/specification/#parameter-object
14
 */
15
class Parameter implements ValueObjectInterface
16
{
17
    use CompositeValueObjectWithExtension;
18
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var ParameterIn
26
     */
27
    private $in;
28
29
    /**
30
     * @var string|null
31
     */
32
    private $description;
0 ignored issues
show
introduced by
The private property $description is not used, and could be removed.
Loading history...
33
34
    /**
35
     * @var bool|null
36
     */
37
    private $required;
0 ignored issues
show
introduced by
The private property $required is not used, and could be removed.
Loading history...
38
39
    /**
40
     * @var bool|null
41
     */
42
    private $deprecated;
0 ignored issues
show
introduced by
The private property $deprecated is not used, and could be removed.
Loading history...
43
44
    /**
45
     * @var bool|null
46
     */
47
    private $allowEmptyValue;
0 ignored issues
show
introduced by
The private property $allowEmptyValue is not used, and could be removed.
Loading history...
48
49
    /**
50
     * @var string|null
51
     */
52
    private $style;
0 ignored issues
show
introduced by
The private property $style is not used, and could be removed.
Loading history...
53
54
    /**
55
     * @var bool|null
56
     */
57
    private $explode;
0 ignored issues
show
introduced by
The private property $explode is not used, and could be removed.
Loading history...
58
59
    /**
60
     * @var bool|null
61
     */
62
    private $allowReserved;
0 ignored issues
show
introduced by
The private property $allowReserved is not used, and could be removed.
Loading history...
63
64
    /**
65
     * @var SchemaContract|Schema|Reference|null
66
     */
67
    private $schema;
0 ignored issues
show
introduced by
The private property $schema is not used, and could be removed.
Loading history...
68
69
    /**
70
     * @var mixed|null
71
     */
72
    private $example;
0 ignored issues
show
introduced by
The private property $example is not used, and could be removed.
Loading history...
73
74
    /**
75
     * @var ExampleMap|null
76
     */
77
    private $examples;
0 ignored issues
show
introduced by
The private property $examples is not used, and could be removed.
Loading history...
78
79
    /**
80
     * @var string|MediaType|null
81
     */
82
    private $content;
0 ignored issues
show
introduced by
The private property $content is not used, and could be removed.
Loading history...
83
84
    public function __construct(string $name, ParameterIn $in)
85
    {
86
        $this->name = $name;
87
        $this->in = $in;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getName(): string
94
    {
95
        return $this->name;
96
    }
97
98
    /**
99
     * @return ParameterIn
100
     */
101
    public function getIn(): ParameterIn
102
    {
103
        return $this->in;
104
    }
105
}
106