Completed
Push — master ( c80d49...d53149 )
by Antoine
18s queued 12s
created

src/Annotation/ApiResource.php (1 issue)

Severity
1
<?php
2
3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace ApiPlatform\Core\Annotation;
15
16
use ApiPlatform\Core\Exception\InvalidArgumentException;
17
18
/**
19
 * ApiResource annotation.
20
 *
21
 * @author Kévin Dunglas <[email protected]>
22
 *
23
 * @Annotation
24
 * @Target({"CLASS"})
25
 * @Attributes(
26
 *     @Attribute("accessControl", type="string"),
27
 *     @Attribute("accessControlMessage", type="string"),
28
 *     @Attribute("attributes", type="array"),
29
 *     @Attribute("cacheHeaders", type="array"),
30
 *     @Attribute("collectionOperations", type="array"),
31
 *     @Attribute("denormalizationContext", type="array"),
32
 *     @Attribute("deprecationReason", type="string"),
33
 *     @Attribute("description", type="string"),
34
 *     @Attribute("fetchPartial", type="bool"),
35
 *     @Attribute("forceEager", type="bool"),
36
 *     @Attribute("formats", type="array"),
37
 *     @Attribute("filters", type="string[]"),
38
 *     @Attribute("graphql", type="array"),
39
 *     @Attribute("hydraContext", type="array"),
40
 *     @Attribute("input", type="mixed"),
41
 *     @Attribute("iri", type="string"),
42
 *     @Attribute("itemOperations", type="array"),
43
 *     @Attribute("maximumItemsPerPage", type="int"),
44
 *     @Attribute("mercure", type="mixed"),
45
 *     @Attribute("messenger", type="bool"),
46
 *     @Attribute("normalizationContext", type="array"),
47
 *     @Attribute("openapiContext", type="array"),
48
 *     @Attribute("order", type="array"),
49
 *     @Attribute("output", type="mixed"),
50
 *     @Attribute("paginationClientEnabled", type="bool"),
51
 *     @Attribute("paginationClientItemsPerPage", type="bool"),
52
 *     @Attribute("paginationClientPartial", type="bool"),
53
 *     @Attribute("paginationEnabled", type="bool"),
54
 *     @Attribute("paginationFetchJoinCollection", type="bool"),
55
 *     @Attribute("paginationItemsPerPage", type="int"),
56
 *     @Attribute("paginationPartial", type="bool"),
57
 *     @Attribute("routePrefix", type="string"),
58
 *     @Attribute("shortName", type="string"),
59
 *     @Attribute("subresourceOperations", type="array"),
60
 *     @Attribute("sunset", type="string"),
61
 *     @Attribute("swaggerContext", type="array"),
62
 *     @Attribute("validationGroups", type="mixed")
63
 * )
64
 */
65
final class ApiResource
66
{
67
    use AttributesHydratorTrait;
68
69
    /**
70
     * @var string
71
     */
72
    public $shortName;
73
74
    /**
75
     * @var string
76
     */
77
    public $description;
78
79
    /**
80
     * @var string
81
     */
82
    public $iri;
83
84
    /**
85
     * @var array
86
     */
87
    public $itemOperations;
88
89
    /**
90
     * @var array
91
     */
92
    public $collectionOperations;
93
94
    /**
95
     * @var array
96
     */
97
    public $subresourceOperations;
98
99
    /**
100
     * @var array
101
     */
102
    public $graphql;
103
104
    /**
105
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
106
     *
107
     * @var string
108
     */
109
    private $accessControl;
110
111
    /**
112
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
113
     *
114
     * @var string
115
     */
116
    private $accessControlMessage;
117
118
    /**
119
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
120
     *
121
     * @var array
122
     */
123
    private $cacheHeaders;
124
125
    /**
126
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
127
     *
128
     * @var array
129
     */
130
    private $denormalizationContext;
131
132
    /**
133
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
134
     *
135
     * @var string
136
     */
137
    private $deprecationReason;
138
139
    /**
140
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
141
     *
142
     * @var bool
143
     */
144
    private $fetchPartial;
145
146
    /**
147
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
148
     *
149
     * @var bool
150
     */
151
    private $forceEager;
152
153
    /**
154
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
155
     *
156
     * @var array
157
     */
158
    private $formats;
159
160
    /**
161
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
162
     *
163
     * @var string[]
164
     */
165
    private $filters;
166
167
    /**
168
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
169
     *
170
     * @var string[]
171
     */
172
    private $hydraContext;
173
174
    /**
175
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
176
     *
177
     * @var int
178
     */
179
    private $maximumItemsPerPage;
180
181
    /**
182
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
183
     *
184
     * @var mixed
185
     */
186
    private $mercure;
187
188
    /**
189
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
190
     *
191
     * @var bool
192
     */
193
    private $messenger;
194
195
    /**
196
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
197
     *
198
     * @var array
199
     */
200
    private $normalizationContext;
201
202
    /**
203
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
204
     *
205
     * @var array
206
     */
207
    private $order;
208
209
    /**
210
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
211
     *
212
     * @var bool
213
     */
214
    private $paginationClientEnabled;
215
216
    /**
217
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
218
     *
219
     * @var bool
220
     */
221
    private $paginationClientItemsPerPage;
222
223
    /**
224
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
225
     *
226
     * @var bool
227
     */
228
    private $paginationClientPartial;
229
230
    /**
231
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
232
     *
233
     * @var bool
234
     */
235
    private $paginationEnabled;
236
237
    /**
238
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
239
     *
240
     * @var bool
241
     */
242
    private $paginationFetchJoinCollection;
243
244
    /**
245
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
246
     *
247
     * @var int
248
     */
249
    private $paginationItemsPerPage;
250
251
    /**
252
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
253
     *
254
     * @var int
255
     */
256
    private $paginationPartial;
257
258
    /**
259
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
260
     *
261
     * @var string
262
     */
263
    private $routePrefix;
264
265
    /**
266
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
267
     *
268
     * @var array
269
     */
270
    private $swaggerContext;
271
272
    /**
273
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
274
     *
275
     * @var mixed
276
     */
277
    private $validationGroups;
278
279
    /**
280
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
281
     *
282
     * @var string
283
     */
284
    private $sunset;
285
286
    /**
287
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
288
     *
289
     * @var string|false
290
     */
291
    private $input;
292
293
    /**
294
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
295
     *
296
     * @var string|false
297
     */
298
    private $output;
299
300
    /**
301
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
302
     *
303
     * @var array
304
     */
305
    private $openapiContext;
0 ignored issues
show
The private property $openapiContext is not used, and could be removed.
Loading history...
306
307
    /**
308
     * @throws InvalidArgumentException
309
     */
310
    public function __construct(array $values = [])
311
    {
312
        $this->hydrateAttributes($values);
313
    }
314
}
315