• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 17054069864

18 Aug 2025 10:27PM UTC coverage: 21.952% (+0.2%) from 21.769%
17054069864

Pull #7151

github

web-flow
Merge 0da010d8d into 6491bfc7a
Pull Request #7151: fix: 7119 parameter array shape uses invalid syntax

11524 of 52497 relevant lines covered (21.95%)

11.86 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.75
/src/Metadata/ApiResource.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
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\Metadata;
15

16
use ApiPlatform\Metadata\GraphQl\Operation as GraphQlOperation;
17
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
18
use ApiPlatform\State\OptionsInterface;
19

20
/**
21
 * Resource metadata attribute.
22
 *
23
 * The API Resource attribute declares the behaviors attached to a Resource inside API Platform.
24
 * This class is immutable, and if you set a value yourself, API Platform will not override the value.
25
 * The API Resource helps to share options with operations.
26
 *
27
 * Read more about how metadata works [here](/docs/in-depth/metadata).
28
 *
29
 * @author Antoine Bluchet <soyuka@gmail.com>
30
 */
31
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
32
class ApiResource extends Metadata
33
{
34
    use CascadeToOperationsTrait;
35
    use WithResourceTrait;
36

37
    /**
38
     * @var Operations<HttpOperation>
39
     */
40
    protected ?Operations $operations;
41

42
    /**
43
     * @param list<HttpOperation>|array<string, HttpOperation>|Operations<HttpOperation>|null $operations   Operations is a list of HttpOperation
44
     * @param array<string, Link>|array<string, mixed[]>|string[]|string|null                 $uriVariables
45
     * @param class-string                                                                    $class
46
     * @param array<string, string>                                                           $headers
47
     * @param string|callable|null                                                            $provider
48
     * @param string|callable|null                                                            $processor
49
     * @param mixed|null                                                                      $mercure
50
     * @param mixed|null                                                                      $messenger
51
     * @param mixed|null                                                                      $input
52
     * @param mixed|null                                                                      $output
53
     */
54
    public function __construct(
55
        /**
56
         * The URI template represents your resource IRI with optional variables. It follows [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.html).
57
         * API Platform generates this URL for you if you leave this empty.
58
         */
59
        protected ?string $uriTemplate = null,
60

61
        /**
62
         * The short name of your resource is a unique name that identifies your resource.
63
         * It is used within the documentation and for url generation if the `uriTemplate` is not filled. By default, this will be the name of your PHP class.
64
         */
65
        protected ?string $shortName = null,
66

67
        /**
68
         * A description for this resource that will show on documentations.
69
         */
70
        protected ?string $description = null,
71

72
        /**
73
         * The RDF types of this resource.
74
         * An RDF type is usually a URI referencing how your resource is structured for the outside world. Values can be a string `https://schema.org/Book`
75
         * or an array of string `['https://schema.org/Flight', 'https://schema.org/BusTrip']`.
76
         */
77
        protected string|array|null $types = null,
78

79
        /**
80
         * Operations is a list of [HttpOperation](./HttpOperation).
81
         *
82
         * By default API Platform declares operations representing CRUD routes if you don't specify this parameter:
83
         *
84
         * ```php
85
         * #[ApiResource(
86
         *     operations: [
87
         *         new Get(uriTemplate: '/books/{id}'),
88
         *         // The GetCollection operation returns a list of Books.
89
         *         new GetCollection(uriTemplate: '/books'),
90
         *         new Post(uriTemplate: '/books'),
91
         *         new Patch(uriTemplate: '/books/{id}'),
92
         *         new Delete(uriTemplate: '/books/{id}'),
93
         *     ]
94
         * )]
95
         *
96
         * ```
97
         *
98
         * Try this live at [play.api-platform.com/api-resource](play.api-platform.com).
99
         */
100
        $operations = null,
101

102
        /**
103
         * The `formats` option allows you to customize content negotiation. By default API Platform supports JsonLd, Hal, JsonAPI.
104
         * For other formats we use the Symfony Serializer.
105
         *
106
         * ```php
107
         * #[ApiResource(
108
         *   formats: [
109
         *       'jsonld' => ['application/ld+json'],
110
         *       'jsonhal' => ['application/hal+json'],
111
         *       'jsonapi' => ['application/vnd.api+json'],
112
         *       'json' =>    ['application/json'],
113
         *       'xml' =>     ['application/xml', 'text/xml'],
114
         *       'yaml' =>    ['application/yaml'],
115
         *       'csv' =>     ['text/csv'],
116
         *       'html' =>    ['text/html'],
117
         *       'myformat' =>['application/vnd.myformat'],
118
         *   ]
119
         * )]
120
         * ```
121
         *
122
         * Learn more about custom formats in the [dedicated guide](/guides/custom-formats).
123
         */
124
        protected array|string|null $formats = null,
125
        /**
126
         * The `inputFormats` option allows you to customize content negotiation for HTTP bodies:.
127
         *
128
         * ```php
129
         *  #[ApiResource(formats: ['jsonld', 'csv' => ['text/csv']], operations: [
130
         *      new Patch(inputFormats: ['json' => ['application/merge-patch+json']]),
131
         *      new GetCollection(),
132
         *      new Post(),
133
         *  ])]
134
         * ```
135
         */
136
        protected array|string|null $inputFormats = null,
137
        /**
138
         * The `outputFormats` option allows you to customize content negotiation for HTTP responses.
139
         */
140
        protected array|string|null $outputFormats = null,
141
        /**
142
         * The `uriVariables` configuration allows to configure to what each URI Variable.
143
         * With [simple string expansion](https://www.rfc-editor.org/rfc/rfc6570.html#section-3.2.2), we read the input
144
         * value and match this to the given `Link`. Note that this setting is usually used on an operation directly:.
145
         *
146
         * ```php
147
         *   #[ApiResource(
148
         *       uriTemplate: '/companies/{companyId}/employees/{id}',
149
         *       uriVariables: [
150
         *           'companyId' => new Link(fromClass: Company::class, toProperty: 'company'),
151
         *           'id' => new Link(fromClass: Employee::class)
152
         *       ],
153
         *       operations: [new Get()]
154
         *   )]
155
         * ```
156
         *
157
         * For more examples, read our guide on [subresources](/guides/subresources).
158
         */
159
        protected $uriVariables = null,
160
        /**
161
         * The `routePrefix` allows you to configure a prefix that will apply to this resource.
162
         *
163
         * ```php
164
         *   #[ApiResource(
165
         *       routePrefix: '/books',
166
         *       operations: [new Get(uriTemplate: '/{id}')]
167
         *   )]
168
         * ```
169
         *
170
         * This resource will be accessible through `/books/{id}`.
171
         */
172
        protected ?string $routePrefix = null,
173
        /**
174
         * The `defaults` option adds up to [Symfony's route defaults](https://github.com/symfony/routing/blob/8f068b792e515b25e26855ac8dc7fe800399f3e5/Route.php#L41). You can override [API Platform's defaults](https://github.com/api-platform/core/blob/6abd0fe0a69d4842eb6d5c31ef2bd6dce0e1d372/src/Symfony/Routing/ApiLoader.php#L87) if needed.
175
         */
176
        protected ?array $defaults = null,
177
        /**
178
         * The `requirements` option configures the Symfony's Route requirements.
179
         */
180
        protected ?array $requirements = null,
181
        /**
182
         * The `options` option configures the Symfony's Route options.
183
         */
184
        protected ?array $options = null,
185
        /**
186
         * The `stateless` option configures the Symfony's Route stateless option.
187
         */
188
        protected ?bool $stateless = null,
189
        /**
190
         * The `sunset` option indicates when a deprecated operation will be removed.
191
         *
192
         * <div data-code-selector>
193
         *
194
         * ```php
195
         * <?php
196
         * // api/src/Entity/Parchment.php
197
         * use ApiPlatform\Metadata\ApiResource;
198
         *
199
         * #[ApiResource(deprecationReason: 'Create a Book instead', sunset: '01/01/2020')]
200
         * class Parchment
201
         * {
202
         *     // ...
203
         * }
204
         * ```
205
         *
206
         * ```yaml
207
         * # api/config/api_platform/resources.yaml
208
         * resources:
209
         *     App\Entity\Parchment:
210
         *         - deprecationReason: 'Create a Book instead'
211
         *           sunset: '01/01/2020'
212
         * ```
213
         *
214
         * ```xml
215
         * <?xml version="1.0" encoding="UTF-8" ?>
216
         * <!-- api/config/api_platform/resources.xml -->
217
         *
218
         * <resources
219
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
220
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
221
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
222
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
223
         *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" sunset="01/01/2020" />
224
         * </resources>
225
         * ```
226
         *
227
         * </div>
228
         */
229
        protected ?string $sunset = null,
230
        protected ?string $acceptPatch = null,
231
        protected ?int $status = null,
232
        protected ?string $host = null,
233
        protected ?array $schemes = null,
234
        protected ?string $condition = null,
235
        protected ?string $controller = null,
236
        protected ?string $class = null,
237
        /**
238
         * The `urlGenerationStrategy` option configures the url generation strategy.
239
         *
240
         * See: [UrlGeneratorInterface::class](/reference/Api/UrlGeneratorInterface)
241
         *
242
         * <div data-code-selector>
243
         *
244
         * ```php
245
         * <?php
246
         * // api/src/Entity/Book.php
247
         * use ApiPlatform\Metadata\ApiResource;
248
         * use ApiPlatform\Api\UrlGeneratorInterface;
249
         *
250
         * #[ApiResource(urlGenerationStrategy: UrlGeneratorInterface::ABS_URL)]
251
         * class Book
252
         * {
253
         *     // ...
254
         * }
255
         * ```
256
         *
257
         * ```yaml
258
         * # api/config/api_platform/resources.yaml
259
         * App\Entity\Book:
260
         *     urlGenerationStrategy: !php/const ApiPlatform\Metadata\UrlGeneratorInterface::ABS_URL
261
         * ```
262
         *
263
         * ```xml
264
         * <?xml version="1.0" encoding="UTF-8" ?>
265
         * <!-- api/config/api_platform/resources.xml -->
266
         *
267
         * <resources
268
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
269
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
270
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
271
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
272
         *     <resource class="App\Entity\Book" urlGenerationStrategy="0" />
273
         * </resources>
274
         * ```
275
         *
276
         * </div>
277
         */
278
        protected ?int $urlGenerationStrategy = null,
279
        /**
280
         * The `deprecationReason` option deprecates the current resource with a deprecation message.
281
         *
282
         * <div data-code-selector>
283
         *
284
         * ```php
285
         * <?php
286
         * // api/src/Entity/Parchment.php
287
         * use ApiPlatform\Metadata\ApiResource;
288
         *
289
         * #[ApiResource(deprecationReason: 'Create a Book instead')]
290
         * class Parchment
291
         * {
292
         *     // ...
293
         * }
294
         * ```
295
         *
296
         * ```yaml
297
         * # api/config/api_platform/resources.yaml
298
         * resources:
299
         *     App\Entity\Parchment:
300
         *         - deprecationReason: 'Create a Book instead'
301
         * ```
302
         *
303
         * ```xml
304
         * <?xml version="1.0" encoding="UTF-8" ?>
305
         * <!-- api/config/api_platform/resources.xml -->
306
         *
307
         * <resources
308
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
309
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
310
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
311
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
312
         *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" />
313
         * </resources>
314
         * ```
315
         *
316
         * </div>
317
         *
318
         * - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
319
         * - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
320
         * - With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema
321
         */
322
        protected ?string $deprecationReason = null,
323
        protected ?array $headers = null,
324
        protected ?array $cacheHeaders = null,
325
        protected ?array $normalizationContext = null,
326
        protected ?array $denormalizationContext = null,
327
        protected ?bool $collectDenormalizationErrors = null,
328
        protected ?array $hydraContext = null,
329
        protected bool|OpenApiOperation|null $openapi = null,
330
        /**
331
         * The `validationContext` option configures the context of validation for the current ApiResource.
332
         * You can, for instance, describe the validation groups that will be used:.
333
         *
334
         * ```php
335
         * #[ApiResource(validationContext: ['groups' => ['a', 'b']])]
336
         * ```
337
         *
338
         * For more examples, read our guide on [validation](/guides/validation).
339
         */
340
        protected ?array $validationContext = null,
341
        /**
342
         * The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
343
         *
344
         * <div data-code-selector>
345
         *
346
         * ```php
347
         * <?php
348
         * // api/src/Entity/Book.php
349
         * use ApiPlatform\Metadata\ApiResource;
350
         *
351
         * #[ApiResource(filters: ['app.filters.book.search'])]
352
         * class Book
353
         * {
354
         *     // ...
355
         * }
356
         * ```
357
         *
358
         * ```yaml
359
         * # api/config/api_platform/resources.yaml
360
         * resources:
361
         *     App\Entity\Book:
362
         *         - filters: ['app.filters.book.search']
363
         * ```
364
         *
365
         * ```xml
366
         * <?xml version="1.0" encoding="UTF-8" ?>
367
         * <!-- api/config/api_platform/resources.xml -->
368
         * <resources
369
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
370
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
371
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
372
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
373
         *     <resource class="App\Entity\Book">
374
         *         <filters>
375
         *             <filter>app.filters.book.search</filter>
376
         *         </filters>
377
         *     </resource>
378
         * </resources>
379
         * ```
380
         *
381
         * </div>
382
         */
383
        protected ?array $filters = null,
384
        protected $mercure = null,
385
        /**
386
         * The `messenger` option dispatches the current resource through the Message Bus.
387
         *
388
         * <div data-code-selector>
389
         *
390
         * ```php
391
         * <?php
392
         * // api/src/Entity/Book.php
393
         * use ApiPlatform\Metadata\ApiResource;
394
         *
395
         * #[ApiResource(messenger: true)]
396
         * class Book
397
         * {
398
         *     // ...
399
         * }
400
         * ```
401
         *
402
         * ```yaml
403
         * # api/config/api_platform/resources.yaml
404
         * resources:
405
         *     App\Entity\Book:
406
         *         - messenger: true
407
         * ```
408
         *
409
         * ```xml
410
         * <?xml version="1.0" encoding="UTF-8" ?>
411
         * <!-- api/config/api_platform/resources.xml -->
412
         *
413
         * <resources
414
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
415
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
416
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
417
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
418
         *     <resource class="App\Entity\Book" messenger=true />
419
         * </resources>
420
         * ```
421
         *
422
         * </div>
423
         *
424
         * Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
425
         * to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
426
         * and implement your own logic.
427
         *
428
         * Read [how to use Messenger with an Input object](/docs/guide/using-messenger-with-an-input-object).
429
         *
430
         * @var string|bool|null
431
         */
432
        protected $messenger = null,
433
        protected $input = null,
434
        protected $output = null,
435
        /**
436
         * Override the default order of items in your collection. Note that this is handled by our doctrine filters such as
437
         * the [OrderFilter](/docs/reference/Doctrine/Orm/Filter/OrderFilter).
438
         *
439
         * By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
440
         * customize this order, you must add an `order` attribute on your ApiResource annotation:
441
         *
442
         * <div data-code-selector>
443
         *
444
         * ```php
445
         * <?php
446
         * // api/src/Entity/Book.php
447
         * namespace App\Entity;
448
         *
449
         * use ApiPlatform\Metadata\ApiResource;
450
         *
451
         * #[ApiResource(order: ['foo' => 'ASC'])]
452
         * class Book
453
         * {
454
         * }
455
         * ```
456
         *
457
         * ```yaml
458
         * # api/config/api_platform/resources/Book.yaml
459
         * App\Entity\Book:
460
         *     order:
461
         *         foo: ASC
462
         * ```
463
         *
464
         * </div>
465
         *
466
         * This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
467
         * If you only specify the key, `ASC` direction will be used as default.
468
         */
469
        protected ?array $order = null,
470
        protected ?bool $fetchPartial = null,
471
        protected ?bool $forceEager = null,
472
        /**
473
         * The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
474
         *
475
         * <div data-code-selector>
476
         *
477
         * ```php
478
         * <?php
479
         * // api/src/Entity/Book.php
480
         * use ApiPlatform\Metadata\ApiResource;
481
         *
482
         * #[ApiResource(paginationClientEnabled: true)]
483
         * class Book
484
         * {
485
         *     // ...
486
         * }
487
         * ```
488
         *
489
         * ```yaml
490
         * # api/config/api_platform/resources.yaml
491
         * resources:
492
         *     App\Entity\Book:
493
         *         - paginationClientEnabled: true
494
         * ```
495
         *
496
         * ```xml
497
         * <?xml version="1.0" encoding="UTF-8" ?>
498
         * <!-- api/config/api_platform/resources.xml -->
499
         *
500
         * <resources
501
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
502
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
503
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
504
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
505
         *     <resource class="App\Entity\Book" paginationClientEnabled=true />
506
         * </resources>
507
         * ```
508
         *
509
         * </div>
510
         *
511
         * The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
512
         * - `GET /books?pagination=false`: disabled
513
         * - `GET /books?pagination=true`: enabled
514
         */
515
        protected ?bool $paginationClientEnabled = null,
516
        /**
517
         * The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
518
         *
519
         * <div data-code-selector>
520
         *
521
         * ```php
522
         * <?php
523
         * // api/src/Entity/Book.php
524
         * use ApiPlatform\Metadata\ApiResource;
525
         *
526
         * #[ApiResource(paginationClientItemsPerPage: true)]
527
         * class Book
528
         * {
529
         *     // ...
530
         * }
531
         * ```
532
         *
533
         * ```yaml
534
         * # api/config/api_platform/resources.yaml
535
         * resources:
536
         *     App\Entity\Book:
537
         *         - paginationClientItemsPerPage: true
538
         * ```
539
         *
540
         * ```xml
541
         * <?xml version="1.0" encoding="UTF-8" ?>
542
         * <!-- api/config/api_platform/resources.xml -->
543
         *
544
         * <resources
545
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
546
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
547
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
548
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
549
         *     <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
550
         * </resources>
551
         * ```
552
         *
553
         * </div>
554
         *
555
         * The number of items can now be set by adding a query parameter named `itemsPerPage`:
556
         * - `GET /books?itemsPerPage=50`
557
         */
558
        protected ?bool $paginationClientItemsPerPage = null,
559
        /**
560
         * The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
561
         *
562
         * <div data-code-selector>
563
         *
564
         * ```php
565
         * <?php
566
         * // api/src/Entity/Book.php
567
         * use ApiPlatform\Metadata\ApiResource;
568
         *
569
         * #[ApiResource(paginationClientPartial: true)]
570
         * class Book
571
         * {
572
         *     // ...
573
         * }
574
         * ```
575
         *
576
         * ```yaml
577
         * # api/config/api_platform/resources.yaml
578
         * resources:
579
         *     App\Entity\Book:
580
         *         - paginationClientPartial: true
581
         * ```
582
         *
583
         * ```xml
584
         * <?xml version="1.0" encoding="UTF-8" ?>
585
         * <!-- api/config/api_platform/resources.xml -->
586
         *
587
         * <resources
588
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
589
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
590
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
591
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
592
         *     <resource class="App\Entity\Book" paginationClientPartial=true />
593
         * </resources>
594
         * ```
595
         *
596
         * </div>
597
         *
598
         * The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
599
         * - `GET /books?partial=false`: disabled
600
         * - `GET /books?partial=true`: enabled
601
         */
602
        protected ?bool $paginationClientPartial = null,
603
        /**
604
         * The `paginationViaCursor` option configures the cursor-based pagination for the current resource.
605
         * Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
606
         * Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
607
         *
608
         * <div data-code-selector>
609
         *
610
         * ```php
611
         * <?php
612
         * // api/src/Entity/Book.php
613
         * use ApiPlatform\Metadata\ApiFilter;
614
         * use ApiPlatform\Metadata\ApiResource;
615
         * use ApiPlatform\Doctrine\Odm\Filter\OrderFilter;
616
         * use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
617
         *
618
         * #[ApiResource(paginationPartial: true, paginationViaCursor: [['field' => 'id', 'direction' => 'DESC']])]
619
         * #[ApiFilter(RangeFilter::class, properties: ["id"])]
620
         * #[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])]
621
         * class Book
622
         * {
623
         *     // ...
624
         * }
625
         * ```
626
         *
627
         * ```yaml
628
         * # api/config/api_platform/resources.yaml
629
         * resources:
630
         *     App\Entity\Book:
631
         *         - paginationPartial: true
632
         *           paginationViaCursor:
633
         *               - { field: 'id', direction: 'DESC' }
634
         *           filters: [ 'app.filters.book.range', 'app.filters.book.order' ]
635
         * ```
636
         *
637
         * ```xml
638
         * <?xml version="1.0" encoding="UTF-8" ?>
639
         * <!-- api/config/api_platform/resources.xml -->
640
         *
641
         * <resources
642
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
643
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
644
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
645
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
646
         *     <resource class="App\Entity\Book" paginationPartial=true>
647
         *         <filters>
648
         *             <filter>app.filters.book.range</filter>
649
         *             <filter>app.filters.book.order</filter>
650
         *         </filters>
651
         *         <paginationViaCursor>
652
         *             <paginationField field="id" direction="DESC" />
653
         *         </paginationViaCursor>
654
         *     </resource>
655
         * </resources>
656
         * ```
657
         *
658
         * </div>
659
         *
660
         * To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
661
         */
662
        protected ?array $paginationViaCursor = null,
663
        /**
664
         * The `paginationEnabled` option enables (or disables) the pagination for the current resource.
665
         *
666
         * <div data-code-selector>
667
         *
668
         * ```php
669
         * <?php
670
         * // api/src/Entity/Book.php
671
         * use ApiPlatform\Metadata\ApiResource;
672
         *
673
         * #[ApiResource(paginationEnabled: true)]
674
         * class Book
675
         * {
676
         *     // ...
677
         * }
678
         * ```
679
         *
680
         * ```yaml
681
         * # api/config/api_platform/resources.yaml
682
         * resources:
683
         *     App\Entity\Book:
684
         *         - paginationEnabled: true
685
         * ```
686
         *
687
         * ```xml
688
         * <?xml version="1.0" encoding="UTF-8" ?>
689
         * <!-- api/config/api_platform/resources.xml -->
690
         *
691
         * <resources
692
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
693
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
694
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
695
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
696
         *     <resource class="App\Entity\Book" paginationEnabled=true />
697
         * </resources>
698
         * ```
699
         *
700
         * </div>
701
         */
702
        protected ?bool $paginationEnabled = null,
703
        /**
704
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
705
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$fetchJoinCollection`
706
         * argument, whether there is a join to a collection-valued association.
707
         *
708
         * When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
709
         * correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
710
         *
711
         * <div data-code-selector>
712
         *
713
         * ```php
714
         * <?php
715
         * // api/src/Entity/Book.php
716
         * use ApiPlatform\Metadata\ApiResource;
717
         *
718
         * #[ApiResource(paginationFetchJoinCollection: false)]
719
         * class Book
720
         * {
721
         *     // ...
722
         * }
723
         * ```
724
         *
725
         * ```yaml
726
         * # api/config/api_platform/resources.yaml
727
         * resources:
728
         *     App\Entity\Book:
729
         *         - paginationFetchJoinCollection: false
730
         * ```
731
         *
732
         * ```xml
733
         * <?xml version="1.0" encoding="UTF-8" ?>
734
         * <!-- api/config/api_platform/resources.xml -->
735
         *
736
         * <resources
737
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
738
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
739
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
740
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
741
         *     <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
742
         * </resources>
743
         * ```
744
         *
745
         * </div>
746
         *
747
         * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
748
         */
749
        protected ?bool $paginationFetchJoinCollection = null,
750
        /**
751
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
752
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$setUseOutputWalkers` setter,
753
         * whether to use output walkers.
754
         *
755
         * When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
756
         * of queries. You can configure this using the `paginationUseOutputWalkers` option:
757
         *
758
         * <div data-code-selector>
759
         *
760
         * ```php
761
         * <?php
762
         * // api/src/Entity/Book.php
763
         * use ApiPlatform\Metadata\ApiResource;
764
         *
765
         * #[ApiResource(paginationUseOutputWalkers: false)]
766
         * class Book
767
         * {
768
         *     // ...
769
         * }
770
         * ```
771
         *
772
         * ```yaml
773
         * # api/config/api_platform/resources.yaml
774
         * resources:
775
         *     App\Entity\Book:
776
         *         - paginationUseOutputWalkers: false
777
         * ```
778
         *
779
         * ```xml
780
         * <?xml version="1.0" encoding="UTF-8" ?>
781
         * <!-- api/config/api_platform/resources.xml -->
782
         * <resources
783
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
784
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
785
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
786
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
787
         *     <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
788
         * </resources>
789
         * ```
790
         *
791
         * </div>
792
         *
793
         * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
794
         */
795
        protected ?bool $paginationUseOutputWalkers = null,
796
        /**
797
         * The `paginationItemsPerPage` option defines the number of items per page for the current resource.
798
         *
799
         * <div data-code-selector>
800
         *
801
         * ```php
802
         * <?php
803
         * // api/src/Entity/Book.php
804
         * use ApiPlatform\Metadata\ApiResource;
805
         *
806
         * #[ApiResource(paginationItemsPerPage: 30)]
807
         * class Book
808
         * {
809
         *     // ...
810
         * }
811
         * ```
812
         *
813
         * ```yaml
814
         * # api/config/api_platform/resources.yaml
815
         * resources:
816
         *     App\Entity\Book:
817
         *         - paginationItemsPerPage: 30
818
         * ```
819
         *
820
         * ```xml
821
         * <?xml version="1.0" encoding="UTF-8" ?>
822
         * <!-- api/config/api_platform/resources.xml -->
823
         * <resources
824
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
825
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
826
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
827
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
828
         *     <resource class="App\Entity\Book" paginationItemsPerPage=30 />
829
         * </resources>
830
         * ```
831
         *
832
         * </div>
833
         */
834
        protected ?int $paginationItemsPerPage = null,
835
        /**
836
         * The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
837
         *
838
         * <div data-code-selector>
839
         *
840
         * ```php
841
         * <?php
842
         * // api/src/Entity/Book.php
843
         * use ApiPlatform\Metadata\ApiResource;
844
         *
845
         * #[ApiResource(paginationMaximumItemsPerPage: 50)]
846
         * class Book
847
         * {
848
         *     // ...
849
         * }
850
         * ```
851
         *
852
         * ```yaml
853
         * # api/config/api_platform/resources.yaml
854
         * resources:
855
         *     App\Entity\Book:
856
         *         - paginationMaximumItemsPerPage: 50
857
         * ```
858
         *
859
         * ```xml
860
         * <?xml version="1.0" encoding="UTF-8" ?>
861
         * <!-- api/config/api_platform/resources.xml -->
862
         * <resources
863
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
864
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
865
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
866
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
867
         *     <resource class="App\Entity\Book" paginationMaximumItemsPerPage=50 />
868
         * </resources>
869
         * ```
870
         *
871
         * </div>
872
         */
873
        protected ?int $paginationMaximumItemsPerPage = null,
874
        /**
875
         * The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
876
         *
877
         * <div data-code-selector>
878
         *
879
         * ```php
880
         * <?php
881
         * // api/src/Entity/Book.php
882
         * use ApiPlatform\Metadata\ApiResource;
883
         *
884
         * #[ApiResource(paginationPartial: true)]
885
         * class Book
886
         * {
887
         *     // ...
888
         * }
889
         * ```
890
         *
891
         * ```yaml
892
         * # api/config/api_platform/resources.yaml
893
         * resources:
894
         *     App\Entity\Book:
895
         *         - paginationPartial: true
896
         * ```
897
         *
898
         * ```xml
899
         * <?xml version="1.0" encoding="UTF-8" ?>
900
         * <!-- api/config/api_platform/resources.xml -->
901
         * <resources
902
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
903
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
904
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
905
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
906
         *     <resource class="App\Entity\Book" paginationPartial=true />
907
         * </resources>
908
         * ```
909
         *
910
         * </div>
911
         */
912
        protected ?bool $paginationPartial = null,
913
        /**
914
         * The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
915
         *
916
         * <div data-code-selector>
917
         *
918
         * ```php
919
         * <?php
920
         * // api/src/Entity/Book.php
921
         * use ApiPlatform\Metadata\ApiResource;
922
         *
923
         * #[ApiResource(paginationType: 'page')]
924
         * class Book
925
         * {
926
         *     // ...
927
         * }
928
         * ```
929
         *
930
         * ```yaml
931
         * # api/config/api_platform/resources.yaml
932
         * resources:
933
         *     App\Entity\Book:
934
         *         - paginationType: page
935
         * ```
936
         *
937
         * ```xml
938
         * <?xml version="1.0" encoding="UTF-8" ?>
939
         * <!-- api/config/api_platform/resources.xml -->
940
         * <resources
941
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
942
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
943
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
944
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
945
         *     <resource class="App\Entity\Book" paginationType="page" />
946
         * </resources>
947
         * ```
948
         *
949
         * </div>
950
         */
951
        protected ?string $paginationType = null,
952
        protected string|\Stringable|null $security = null,
953
        protected ?string $securityMessage = null,
954
        protected string|\Stringable|null $securityPostDenormalize = null,
955
        protected ?string $securityPostDenormalizeMessage = null,
956
        protected string|\Stringable|null $securityPostValidation = null,
957
        protected ?string $securityPostValidationMessage = null,
958
        protected ?bool $compositeIdentifier = null,
959
        protected ?array $exceptionToStatus = null,
960
        protected ?bool $queryParameterValidationEnabled = null,
961
        protected ?array $links = null,
962
        protected ?array $graphQlOperations = null,
963
        $provider = null,
964
        $processor = null,
965
        protected ?OptionsInterface $stateOptions = null,
966
        protected mixed $rules = null,
967
        ?string $policy = null,
968
        array|string|null $middleware = null,
969
        array|Parameters|null $parameters = null,
970
        protected ?bool $strictQueryParameterValidation = null,
971
        protected ?bool $hideHydraOperation = null,
972
        protected array $extraProperties = [],
973
    ) {
974
        parent::__construct(
111✔
975
            shortName: $shortName,
111✔
976
            class: $class,
111✔
977
            description: $description,
111✔
978
            urlGenerationStrategy: $urlGenerationStrategy,
111✔
979
            deprecationReason: $deprecationReason,
111✔
980
            normalizationContext: $normalizationContext,
111✔
981
            denormalizationContext: $denormalizationContext,
111✔
982
            collectDenormalizationErrors: $collectDenormalizationErrors,
111✔
983
            validationContext: $validationContext,
111✔
984
            filters: $filters,
111✔
985
            mercure: $mercure,
111✔
986
            messenger: $messenger,
111✔
987
            input: $input,
111✔
988
            output: $output,
111✔
989
            order: $order,
111✔
990
            fetchPartial: $fetchPartial,
111✔
991
            forceEager: $forceEager,
111✔
992
            paginationEnabled: $paginationEnabled,
111✔
993
            paginationType: $paginationType,
111✔
994
            paginationItemsPerPage: $paginationItemsPerPage,
111✔
995
            paginationMaximumItemsPerPage: $paginationMaximumItemsPerPage,
111✔
996
            paginationPartial: $paginationPartial,
111✔
997
            paginationClientEnabled: $paginationClientEnabled,
111✔
998
            paginationClientItemsPerPage: $paginationClientItemsPerPage,
111✔
999
            paginationClientPartial: $paginationClientPartial,
111✔
1000
            paginationFetchJoinCollection: $paginationFetchJoinCollection,
111✔
1001
            paginationUseOutputWalkers: $paginationUseOutputWalkers,
111✔
1002
            security: $security,
111✔
1003
            securityMessage: $securityMessage,
111✔
1004
            securityPostDenormalize: $securityPostDenormalize,
111✔
1005
            securityPostDenormalizeMessage: $securityPostDenormalizeMessage,
111✔
1006
            securityPostValidation: $securityPostValidation,
111✔
1007
            securityPostValidationMessage: $securityPostValidationMessage,
111✔
1008
            provider: $provider,
111✔
1009
            processor: $processor,
111✔
1010
            stateOptions: $stateOptions,
111✔
1011
            parameters: $parameters,
111✔
1012
            rules: $rules,
111✔
1013
            policy: $policy,
111✔
1014
            middleware: $middleware,
111✔
1015
            strictQueryParameterValidation: $strictQueryParameterValidation,
111✔
1016
            hideHydraOperation: $hideHydraOperation,
111✔
1017
            extraProperties: $extraProperties
111✔
1018
        );
111✔
1019

1020
        /* @var Operations<HttpOperation> $operations> */
1021
        $this->operations = null === $operations ? null : new Operations($operations);
111✔
1022
        $this->provider = $provider;
111✔
1023
        $this->processor = $processor;
111✔
1024
        if (\is_string($types)) {
111✔
1025
            $this->types = (array) $types;
×
1026
        }
1027
    }
1028

1029
    /**
1030
     * @return Operations<HttpOperation>|null
1031
     */
1032
    public function getOperations(): ?Operations
1033
    {
1034
        return $this->operations;
384✔
1035
    }
1036

1037
    /**
1038
     * @param Operations<HttpOperation> $operations
1039
     */
1040
    public function withOperations(Operations $operations): static
1041
    {
1042
        $self = clone $this;
98✔
1043
        $self->operations = $operations;
98✔
1044
        $self->operations->sort();
98✔
1045

1046
        return $self;
98✔
1047
    }
1048

1049
    public function getUriTemplate(): ?string
1050
    {
1051
        return $this->uriTemplate;
55✔
1052
    }
1053

1054
    public function withUriTemplate(string $uriTemplate): static
1055
    {
1056
        $self = clone $this;
×
1057
        $self->uriTemplate = $uriTemplate;
×
1058

1059
        return $self;
×
1060
    }
1061

1062
    public function getTypes(): ?array
1063
    {
1064
        return $this->types;
55✔
1065
    }
1066

1067
    /**
1068
     * @param string[]|string $types
1069
     */
1070
    public function withTypes(array|string $types): static
1071
    {
1072
        $self = clone $this;
2✔
1073
        $self->types = (array) $types;
2✔
1074

1075
        return $self;
2✔
1076
    }
1077

1078
    /**
1079
     * @return array|mixed|string|null
1080
     */
1081
    public function getFormats()
1082
    {
1083
        return $this->formats;
55✔
1084
    }
1085

1086
    public function withFormats(mixed $formats): static
1087
    {
1088
        $self = clone $this;
×
1089
        $self->formats = $formats;
×
1090

1091
        return $self;
×
1092
    }
1093

1094
    /**
1095
     * @return array|mixed|string|null
1096
     */
1097
    public function getInputFormats()
1098
    {
1099
        return $this->inputFormats;
55✔
1100
    }
1101

1102
    /**
1103
     * @param mixed|null $inputFormats
1104
     */
1105
    public function withInputFormats($inputFormats): static
1106
    {
1107
        $self = clone $this;
×
1108
        $self->inputFormats = $inputFormats;
×
1109

1110
        return $self;
×
1111
    }
1112

1113
    /**
1114
     * @return array|mixed|string|null
1115
     */
1116
    public function getOutputFormats()
1117
    {
1118
        return $this->outputFormats;
63✔
1119
    }
1120

1121
    /**
1122
     * @param mixed|null $outputFormats
1123
     */
1124
    public function withOutputFormats($outputFormats): static
1125
    {
1126
        $self = clone $this;
×
1127
        $self->outputFormats = $outputFormats;
×
1128

1129
        return $self;
×
1130
    }
1131

1132
    /**
1133
     * @return array<string, Link>|array<string, array>|string[]|string|null
1134
     */
1135
    public function getUriVariables()
1136
    {
1137
        return $this->uriVariables;
55✔
1138
    }
1139

1140
    /**
1141
     * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
1142
     */
1143
    public function withUriVariables($uriVariables): static
1144
    {
1145
        $self = clone $this;
52✔
1146
        $self->uriVariables = $uriVariables;
52✔
1147

1148
        return $self;
52✔
1149
    }
1150

1151
    public function getRoutePrefix(): ?string
1152
    {
1153
        return $this->routePrefix;
55✔
1154
    }
1155

1156
    public function withRoutePrefix(string $routePrefix): static
1157
    {
1158
        $self = clone $this;
×
1159
        $self->routePrefix = $routePrefix;
×
1160

1161
        return $self;
×
1162
    }
1163

1164
    public function getDefaults(): ?array
1165
    {
1166
        return $this->defaults;
55✔
1167
    }
1168

1169
    public function withDefaults(array $defaults): static
1170
    {
1171
        $self = clone $this;
×
1172
        $self->defaults = $defaults;
×
1173

1174
        return $self;
×
1175
    }
1176

1177
    public function getRequirements(): ?array
1178
    {
1179
        return $this->requirements;
55✔
1180
    }
1181

1182
    public function withRequirements(array $requirements): static
1183
    {
1184
        $self = clone $this;
×
1185
        $self->requirements = $requirements;
×
1186

1187
        return $self;
×
1188
    }
1189

1190
    public function getOptions(): ?array
1191
    {
1192
        return $this->options;
55✔
1193
    }
1194

1195
    public function withOptions(array $options): static
1196
    {
1197
        $self = clone $this;
×
1198
        $self->options = $options;
×
1199

1200
        return $self;
×
1201
    }
1202

1203
    public function getStateless(): ?bool
1204
    {
1205
        return $this->stateless;
55✔
1206
    }
1207

1208
    public function withStateless(bool $stateless): static
1209
    {
1210
        $self = clone $this;
×
1211
        $self->stateless = $stateless;
×
1212

1213
        return $self;
×
1214
    }
1215

1216
    public function getSunset(): ?string
1217
    {
1218
        return $this->sunset;
55✔
1219
    }
1220

1221
    public function withSunset(string $sunset): static
1222
    {
1223
        $self = clone $this;
×
1224
        $self->sunset = $sunset;
×
1225

1226
        return $self;
×
1227
    }
1228

1229
    public function getAcceptPatch(): ?string
1230
    {
1231
        return $this->acceptPatch;
55✔
1232
    }
1233

1234
    public function withAcceptPatch(string $acceptPatch): static
1235
    {
1236
        $self = clone $this;
×
1237
        $self->acceptPatch = $acceptPatch;
×
1238

1239
        return $self;
×
1240
    }
1241

1242
    public function getStatus(): ?int
1243
    {
1244
        return $this->status;
63✔
1245
    }
1246

1247
    /**
1248
     * @param int $status
1249
     */
1250
    public function withStatus($status): static
1251
    {
1252
        $self = clone $this;
11✔
1253
        $self->status = $status;
11✔
1254

1255
        return $self;
11✔
1256
    }
1257

1258
    public function getHost(): ?string
1259
    {
1260
        return $this->host;
55✔
1261
    }
1262

1263
    public function withHost(string $host): static
1264
    {
1265
        $self = clone $this;
×
1266
        $self->host = $host;
×
1267

1268
        return $self;
×
1269
    }
1270

1271
    public function getSchemes(): ?array
1272
    {
1273
        return $this->schemes;
55✔
1274
    }
1275

1276
    public function withSchemes(array $schemes): static
1277
    {
1278
        $self = clone $this;
×
1279
        $self->schemes = $schemes;
×
1280

1281
        return $self;
×
1282
    }
1283

1284
    public function getCondition(): ?string
1285
    {
1286
        return $this->condition;
55✔
1287
    }
1288

1289
    public function withCondition(string $condition): static
1290
    {
1291
        $self = clone $this;
×
1292
        $self->condition = $condition;
×
1293

1294
        return $self;
×
1295
    }
1296

1297
    public function getController(): ?string
1298
    {
1299
        return $this->controller;
55✔
1300
    }
1301

1302
    public function withController(string $controller): static
1303
    {
1304
        $self = clone $this;
×
1305
        $self->controller = $controller;
×
1306

1307
        return $self;
×
1308
    }
1309

1310
    public function getHeaders(): ?array
1311
    {
1312
        return $this->headers;
55✔
1313
    }
1314

1315
    public function withHeaders(array $headers): static
1316
    {
1317
        $self = clone $this;
×
1318
        $self->headers = $headers;
×
1319

1320
        return $self;
×
1321
    }
1322

1323
    public function getCacheHeaders(): ?array
1324
    {
1325
        return $this->cacheHeaders;
55✔
1326
    }
1327

1328
    public function withCacheHeaders(array $cacheHeaders): static
1329
    {
1330
        $self = clone $this;
52✔
1331
        $self->cacheHeaders = $cacheHeaders;
52✔
1332

1333
        return $self;
52✔
1334
    }
1335

1336
    /**
1337
     * @return string[]|null
1338
     */
1339
    public function getHydraContext(): ?array
1340
    {
1341
        return $this->hydraContext;
55✔
1342
    }
1343

1344
    public function withHydraContext(array $hydraContext): static
1345
    {
1346
        $self = clone $this;
×
1347
        $self->hydraContext = $hydraContext;
×
1348

1349
        return $self;
×
1350
    }
1351

1352
    public function getOpenapi(): bool|OpenApiOperation|null
1353
    {
1354
        return $this->openapi;
54✔
1355
    }
1356

1357
    public function withOpenapi(bool|OpenApiOperation $openapi): static
1358
    {
1359
        $self = clone $this;
×
1360
        $self->openapi = $openapi;
×
1361

1362
        return $self;
×
1363
    }
1364

1365
    public function getPaginationViaCursor(): ?array
1366
    {
1367
        return $this->paginationViaCursor;
55✔
1368
    }
1369

1370
    public function withPaginationViaCursor(array $paginationViaCursor): static
1371
    {
1372
        $self = clone $this;
×
1373
        $self->paginationViaCursor = $paginationViaCursor;
×
1374

1375
        return $self;
×
1376
    }
1377

1378
    public function getExceptionToStatus(): ?array
1379
    {
1380
        return $this->exceptionToStatus;
55✔
1381
    }
1382

1383
    public function withExceptionToStatus(array $exceptionToStatus): static
1384
    {
1385
        $self = clone $this;
×
1386
        $self->exceptionToStatus = $exceptionToStatus;
×
1387

1388
        return $self;
×
1389
    }
1390

1391
    /**
1392
     * @return GraphQlOperation[]
1393
     */
1394
    public function getGraphQlOperations(): ?array
1395
    {
1396
        return $this->graphQlOperations;
70✔
1397
    }
1398

1399
    public function withGraphQlOperations(array $graphQlOperations): static
1400
    {
1401
        $self = clone $this;
52✔
1402
        $self->graphQlOperations = $graphQlOperations;
52✔
1403

1404
        return $self;
52✔
1405
    }
1406

1407
    public function getLinks(): ?array
1408
    {
1409
        return $this->links;
55✔
1410
    }
1411

1412
    /**
1413
     * @param Link[] $links
1414
     */
1415
    public function withLinks(array $links): static
1416
    {
1417
        $self = clone $this;
×
1418
        $self->links = $links;
×
1419

1420
        return $self;
×
1421
    }
1422
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc