Passed
Push — master ( 8bd912...d93388 )
by Alan
06:58 queued 02:20
created

src/Annotation/ApiResource.php (33 issues)

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("security", type="string"),
29
 *     @Attribute("securityMessage", type="string"),
30
 *     @Attribute("securityPostDenormalize", type="string"),
31
 *     @Attribute("securityPostDenormalizeMessage", type="string"),
32
 *     @Attribute("attributes", type="array"),
33
 *     @Attribute("cacheHeaders", type="array"),
34
 *     @Attribute("collectionOperations", type="array"),
35
 *     @Attribute("denormalizationContext", type="array"),
36
 *     @Attribute("deprecationReason", type="string"),
37
 *     @Attribute("description", type="string"),
38
 *     @Attribute("elasticsearch", type="bool"),
39
 *     @Attribute("fetchPartial", type="bool"),
40
 *     @Attribute("forceEager", type="bool"),
41
 *     @Attribute("formats", type="array"),
42
 *     @Attribute("filters", type="string[]"),
43
 *     @Attribute("graphql", type="array"),
44
 *     @Attribute("hydraContext", type="array"),
45
 *     @Attribute("input", type="mixed"),
46
 *     @Attribute("iri", type="string"),
47
 *     @Attribute("itemOperations", type="array"),
48
 *     @Attribute("maximumItemsPerPage", type="int"),
49
 *     @Attribute("mercure", type="mixed"),
50
 *     @Attribute("messenger", type="mixed"),
51
 *     @Attribute("normalizationContext", type="array"),
52
 *     @Attribute("openapiContext", type="array"),
53
 *     @Attribute("order", type="array"),
54
 *     @Attribute("output", type="mixed"),
55
 *     @Attribute("paginationClientEnabled", type="bool"),
56
 *     @Attribute("paginationClientItemsPerPage", type="bool"),
57
 *     @Attribute("paginationClientPartial", type="bool"),
58
 *     @Attribute("paginationEnabled", type="bool"),
59
 *     @Attribute("paginationFetchJoinCollection", type="bool"),
60
 *     @Attribute("paginationItemsPerPage", type="int"),
61
 *     @Attribute("paginationPartial", type="bool"),
62
 *     @Attribute("paginationViaCursor", type="array"),
63
 *     @Attribute("routePrefix", type="string"),
64
 *     @Attribute("shortName", type="string"),
65
 *     @Attribute("subresourceOperations", type="array"),
66
 *     @Attribute("sunset", type="string"),
67
 *     @Attribute("swaggerContext", type="array"),
68
 *     @Attribute("validationGroups", type="mixed")
69
 * )
70
 */
71
final class ApiResource
72
{
73
    use AttributesHydratorTrait;
74
75
    /**
76
     * @var string
77
     */
78
    public $shortName;
79
80
    /**
81
     * @var string
82
     */
83
    public $description;
84
85
    /**
86
     * @var string
87
     */
88
    public $iri;
89
90
    /**
91
     * @var array
92
     */
93
    public $itemOperations;
94
95
    /**
96
     * @var array
97
     */
98
    public $collectionOperations;
99
100
    /**
101
     * @var array
102
     */
103
    public $subresourceOperations;
104
105
    /**
106
     * @var array
107
     */
108
    public $graphql;
109
110
    /**
111
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
112
     *
113
     * @var string
114
     */
115
    private $security;
0 ignored issues
show
The private property $security is not used, and could be removed.
Loading history...
116
117
    /**
118
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
119
     *
120
     * @var string
121
     */
122
    private $securityMessage;
0 ignored issues
show
The private property $securityMessage is not used, and could be removed.
Loading history...
123
124
    /**
125
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
126
     *
127
     * @var string
128
     */
129
    private $securityPostDenormalize;
0 ignored issues
show
The private property $securityPostDenormalize is not used, and could be removed.
Loading history...
130
131
    /**
132
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
133
     *
134
     * @var string
135
     */
136
    private $securityPostDenormalizeMessage;
0 ignored issues
show
The private property $securityPostDenormalizeMessage is not used, and could be removed.
Loading history...
137
138
    /**
139
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
140
     *
141
     * @var array
142
     */
143
    private $cacheHeaders;
0 ignored issues
show
The private property $cacheHeaders is not used, and could be removed.
Loading history...
144
145
    /**
146
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
147
     *
148
     * @var array
149
     */
150
    private $denormalizationContext;
0 ignored issues
show
The private property $denormalizationContext is not used, and could be removed.
Loading history...
151
152
    /**
153
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
154
     *
155
     * @var string
156
     */
157
    private $deprecationReason;
0 ignored issues
show
The private property $deprecationReason is not used, and could be removed.
Loading history...
158
159
    /**
160
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
161
     *
162
     * @var bool
163
     */
164
    private $elasticsearch;
0 ignored issues
show
The private property $elasticsearch is not used, and could be removed.
Loading history...
165
166
    /**
167
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
168
     *
169
     * @var bool
170
     */
171
    private $fetchPartial;
0 ignored issues
show
The private property $fetchPartial is not used, and could be removed.
Loading history...
172
173
    /**
174
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
175
     *
176
     * @var bool
177
     */
178
    private $forceEager;
0 ignored issues
show
The private property $forceEager is not used, and could be removed.
Loading history...
179
180
    /**
181
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
182
     *
183
     * @var array
184
     */
185
    private $formats;
0 ignored issues
show
The private property $formats is not used, and could be removed.
Loading history...
186
187
    /**
188
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
189
     *
190
     * @var string[]
191
     */
192
    private $filters;
0 ignored issues
show
The private property $filters is not used, and could be removed.
Loading history...
193
194
    /**
195
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
196
     *
197
     * @var string[]
198
     */
199
    private $hydraContext;
0 ignored issues
show
The private property $hydraContext is not used, and could be removed.
Loading history...
200
201
    /**
202
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
203
     *
204
     * @var int
205
     */
206
    private $maximumItemsPerPage;
0 ignored issues
show
The private property $maximumItemsPerPage is not used, and could be removed.
Loading history...
207
208
    /**
209
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
210
     *
211
     * @var mixed
212
     */
213
    private $mercure;
0 ignored issues
show
The private property $mercure is not used, and could be removed.
Loading history...
214
215
    /**
216
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
217
     *
218
     * @var bool|string
219
     */
220
    private $messenger;
0 ignored issues
show
The private property $messenger is not used, and could be removed.
Loading history...
221
222
    /**
223
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
224
     *
225
     * @var array
226
     */
227
    private $normalizationContext;
0 ignored issues
show
The private property $normalizationContext is not used, and could be removed.
Loading history...
228
229
    /**
230
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
231
     *
232
     * @var array
233
     */
234
    private $order;
0 ignored issues
show
The private property $order is not used, and could be removed.
Loading history...
235
236
    /**
237
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
238
     *
239
     * @var bool
240
     */
241
    private $paginationClientEnabled;
0 ignored issues
show
The private property $paginationClientEnabled is not used, and could be removed.
Loading history...
242
243
    /**
244
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
245
     *
246
     * @var bool
247
     */
248
    private $paginationClientItemsPerPage;
0 ignored issues
show
The private property $paginationClientItemsPerPage is not used, and could be removed.
Loading history...
249
250
    /**
251
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
252
     *
253
     * @var bool
254
     */
255
    private $paginationClientPartial;
0 ignored issues
show
The private property $paginationClientPartial is not used, and could be removed.
Loading history...
256
257
    /**
258
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
259
     *
260
     * @var bool
261
     */
262
    private $paginationEnabled;
0 ignored issues
show
The private property $paginationEnabled is not used, and could be removed.
Loading history...
263
264
    /**
265
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
266
     *
267
     * @var bool
268
     */
269
    private $paginationFetchJoinCollection;
0 ignored issues
show
The private property $paginationFetchJoinCollection is not used, and could be removed.
Loading history...
270
271
    /**
272
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
273
     *
274
     * @var int
275
     */
276
    private $paginationItemsPerPage;
0 ignored issues
show
The private property $paginationItemsPerPage is not used, and could be removed.
Loading history...
277
278
    /**
279
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
280
     *
281
     * @var int
282
     */
283
    private $paginationPartial;
0 ignored issues
show
The private property $paginationPartial is not used, and could be removed.
Loading history...
284
285
    /**
286
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
287
     *
288
     * @var string
289
     */
290
    private $routePrefix;
0 ignored issues
show
The private property $routePrefix is not used, and could be removed.
Loading history...
291
292
    /**
293
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
294
     *
295
     * @var array
296
     */
297
    private $swaggerContext;
0 ignored issues
show
The private property $swaggerContext is not used, and could be removed.
Loading history...
298
299
    /**
300
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
301
     *
302
     * @var mixed
303
     */
304
    private $validationGroups;
0 ignored issues
show
The private property $validationGroups is not used, and could be removed.
Loading history...
305
306
    /**
307
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
308
     *
309
     * @var string
310
     */
311
    private $sunset;
0 ignored issues
show
The private property $sunset is not used, and could be removed.
Loading history...
312
313
    /**
314
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
315
     *
316
     * @var string|false
317
     */
318
    private $input;
0 ignored issues
show
The private property $input is not used, and could be removed.
Loading history...
319
320
    /**
321
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
322
     *
323
     * @var string|false
324
     */
325
    private $output;
0 ignored issues
show
The private property $output is not used, and could be removed.
Loading history...
326
327
    /**
328
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
329
     *
330
     * @var array
331
     */
332
    private $openapiContext;
0 ignored issues
show
The private property $openapiContext is not used, and could be removed.
Loading history...
333
334
    /**
335
     * @see https://github.com/Haehnchen/idea-php-annotation-plugin/issues/112
336
     *
337
     * @var array
338
     */
339
    private $paginationViaCursor;
0 ignored issues
show
The private property $paginationViaCursor is not used, and could be removed.
Loading history...
340
341
    /**
342
     * @throws InvalidArgumentException
343
     */
344
    public function __construct(array $values = [])
345
    {
346
        $this->hydrateAttributes($values);
347
    }
348
}
349