Passed
Branch release/v2.0.0 (52e4c5)
by Anatoly
05:40 queued 01:36
created

Parameter::toArray()   B

Complexity

Conditions 7
Paths 64

Size

Total Lines 37
Code Lines 21

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 56

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 21
c 4
b 0
f 0
dl 0
loc 37
ccs 0
cts 30
cp 0
rs 8.6506
cc 7
nc 64
nop 0
crap 56
1
<?php declare(strict_types=1);
2
3
/**
4
 * It's free open-source software released under the MIT License.
5
 *
6
 * @author Anatoly Fenric <[email protected]>
7
 * @copyright Copyright (c) 2018, Anatoly Fenric
8
 * @license https://github.com/sunrise-php/http-router/blob/master/LICENSE
9
 * @link https://github.com/sunrise-php/http-router
10
 */
11
12
namespace Sunrise\Http\Router\Annotation\OpenApi;
13
14
/**
15
 * @Annotation
16
 *
17
 * @Target({"ALL"})
18
 *
19
 * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#parameter-object
20
 */
21
final class Parameter extends AbstractAnnotation implements ParameterInterface
22
{
23
24
    /**
25
     * @Required
26
     *
27
     * @Enum({"cookie", "header", "query"})
28
     *
29
     * @var string
30
     *
31
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterin
32
     */
33
    public $in;
34
35
    /**
36
     * @Required
37
     *
38
     * @var string
39
     *
40
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parametername
41
     */
42
    public $name;
43
44
    /**
45
     * @var string
46
     *
47
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterdescription
48
     */
49
    public $description;
50
51
    /**
52
     * @var bool
53
     *
54
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterrequired
55
     */
56
    public $required;
57
58
    /**
59
     * @var bool
60
     *
61
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterdeprecated
62
     */
63
    public $deprecated;
64
65
    /**
66
     * @var bool
67
     *
68
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterallowemptyvalue
69
     */
70
    public $allowEmptyValue;
71
72
    /**
73
     * @Enum({"matrix", "label", "form", "simple", "spaceDelimited", "pipeDelimited", "deepObject"})
74
     *
75
     * @var string
76
     *
77
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterstyle
78
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#style-values
79
     */
80
    public $style;
81
82
    /**
83
     * @var bool
84
     *
85
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterexplode
86
     */
87
    public $explode;
88
89
    /**
90
     * @var bool
91
     *
92
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterallowreserved
93
     */
94
    public $allowReserved;
95
96
    /**
97
     * @var \Sunrise\Http\Router\Annotation\OpenApi\SchemaInterface
98
     *
99
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterschema
100
     */
101
    public $schema;
102
103
    /**
104
     * @var mixed
105
     *
106
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterexample
107
     */
108
    public $example;
109
110
    /**
111
     * @var array<\Sunrise\Http\Router\Annotation\OpenApi\ExampleInterface>
112
     *
113
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parameterexamples
114
     */
115
    public $examples;
116
117
    /**
118
     * @var array<\Sunrise\Http\Router\Annotation\OpenApi\MediaTypeInterface>
119
     *
120
     * @link https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#user-content-parametercontent
121
     */
122
    public $content;
123
}
124