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
![]() |
|||
33 | |||
34 | /** |
||
35 | * @var bool|null |
||
36 | */ |
||
37 | private $required; |
||
0 ignored issues
–
show
|
|||
38 | |||
39 | /** |
||
40 | * @var bool|null |
||
41 | */ |
||
42 | private $deprecated; |
||
0 ignored issues
–
show
|
|||
43 | |||
44 | /** |
||
45 | * @var bool|null |
||
46 | */ |
||
47 | private $allowEmptyValue; |
||
0 ignored issues
–
show
|
|||
48 | |||
49 | /** |
||
50 | * @var string|null |
||
51 | */ |
||
52 | private $style; |
||
0 ignored issues
–
show
|
|||
53 | |||
54 | /** |
||
55 | * @var bool|null |
||
56 | */ |
||
57 | private $explode; |
||
0 ignored issues
–
show
|
|||
58 | |||
59 | /** |
||
60 | * @var bool|null |
||
61 | */ |
||
62 | private $allowReserved; |
||
0 ignored issues
–
show
|
|||
63 | |||
64 | /** |
||
65 | * @var SchemaContract|Schema|Reference|null |
||
66 | */ |
||
67 | private $schema; |
||
0 ignored issues
–
show
|
|||
68 | |||
69 | /** |
||
70 | * @var mixed|null |
||
71 | */ |
||
72 | private $example; |
||
0 ignored issues
–
show
|
|||
73 | |||
74 | /** |
||
75 | * @var ExampleMap|null |
||
76 | */ |
||
77 | private $examples; |
||
0 ignored issues
–
show
|
|||
78 | |||
79 | /** |
||
80 | * @var string|MediaType|null |
||
81 | */ |
||
82 | private $content; |
||
0 ignored issues
–
show
|
|||
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 |