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

api-platform / core / 15133993414

20 May 2025 09:30AM UTC coverage: 26.313% (-1.2%) from 27.493%
15133993414

Pull #7161

github

web-flow
Merge e2c03d45f into 5459ba375
Pull Request #7161: fix(metadata): infer parameter string type from schema

0 of 2 new or added lines in 1 file covered. (0.0%)

11019 existing lines in 363 files now uncovered.

12898 of 49018 relevant lines covered (26.31%)

34.33 hits per line

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

61.88
/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 WithResourceTrait;
35

36
    protected ?Operations $operations;
37

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

56
        /**
57
         * The short name of your resource is a unique name that identifies your resource.
58
         * 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.
59
         */
60
        protected ?string $shortName = null,
61

62
        /**
63
         * A description for this resource that will show on documentations.
64
         */
65
        protected ?string $description = null,
66

67
        /**
68
         * The RDF types of this resource.
69
         * 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`
70
         * or an array of string `['https://schema.org/Flight', 'https://schema.org/BusTrip']`.
71
         */
72
        protected string|array|null $types = null,
73

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

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

UNCOV
1017
        $this->operations = null === $operations ? null : new Operations($operations);
129✔
UNCOV
1018
        $this->provider = $provider;
129✔
UNCOV
1019
        $this->processor = $processor;
129✔
UNCOV
1020
        if (\is_string($types)) {
129✔
1021
            $this->types = (array) $types;
×
1022
        }
1023
    }
1024

1025
    public function getOperations(): ?Operations
1026
    {
UNCOV
1027
        return $this->operations;
1,018✔
1028
    }
1029

1030
    public function withOperations(Operations $operations): static
1031
    {
UNCOV
1032
        $self = clone $this;
111✔
UNCOV
1033
        $self->operations = $operations;
111✔
UNCOV
1034
        $self->operations->sort();
111✔
1035

UNCOV
1036
        return $self;
111✔
1037
    }
1038

1039
    public function getUriTemplate(): ?string
1040
    {
UNCOV
1041
        return $this->uriTemplate;
68✔
1042
    }
1043

1044
    public function withUriTemplate(string $uriTemplate): static
1045
    {
1046
        $self = clone $this;
1✔
1047
        $self->uriTemplate = $uriTemplate;
1✔
1048

1049
        return $self;
1✔
1050
    }
1051

1052
    public function getTypes(): ?array
1053
    {
UNCOV
1054
        return $this->types;
72✔
1055
    }
1056

1057
    /**
1058
     * @param string[]|string $types
1059
     */
1060
    public function withTypes(array|string $types): static
1061
    {
UNCOV
1062
        $self = clone $this;
3✔
UNCOV
1063
        $self->types = (array) $types;
3✔
1064

UNCOV
1065
        return $self;
3✔
1066
    }
1067

1068
    /**
1069
     * @return array|mixed|string|null
1070
     */
1071
    public function getFormats()
1072
    {
UNCOV
1073
        return $this->formats;
68✔
1074
    }
1075

1076
    public function withFormats(mixed $formats): static
1077
    {
1078
        $self = clone $this;
×
1079
        $self->formats = $formats;
×
1080

1081
        return $self;
×
1082
    }
1083

1084
    /**
1085
     * @return array|mixed|string|null
1086
     */
1087
    public function getInputFormats()
1088
    {
UNCOV
1089
        return $this->inputFormats;
68✔
1090
    }
1091

1092
    /**
1093
     * @param mixed|null $inputFormats
1094
     */
1095
    public function withInputFormats($inputFormats): static
1096
    {
1097
        $self = clone $this;
×
1098
        $self->inputFormats = $inputFormats;
×
1099

1100
        return $self;
×
1101
    }
1102

1103
    /**
1104
     * @return array|mixed|string|null
1105
     */
1106
    public function getOutputFormats()
1107
    {
UNCOV
1108
        return $this->outputFormats;
87✔
1109
    }
1110

1111
    /**
1112
     * @param mixed|null $outputFormats
1113
     */
1114
    public function withOutputFormats($outputFormats): static
1115
    {
1116
        $self = clone $this;
×
1117
        $self->outputFormats = $outputFormats;
×
1118

1119
        return $self;
×
1120
    }
1121

1122
    /**
1123
     * @return array<string, Link>|array<string, array>|string[]|string|null
1124
     */
1125
    public function getUriVariables()
1126
    {
UNCOV
1127
        return $this->uriVariables;
68✔
1128
    }
1129

1130
    /**
1131
     * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
1132
     */
1133
    public function withUriVariables($uriVariables): static
1134
    {
UNCOV
1135
        $self = clone $this;
65✔
UNCOV
1136
        $self->uriVariables = $uriVariables;
65✔
1137

UNCOV
1138
        return $self;
65✔
1139
    }
1140

1141
    public function getRoutePrefix(): ?string
1142
    {
UNCOV
1143
        return $this->routePrefix;
68✔
1144
    }
1145

1146
    public function withRoutePrefix(string $routePrefix): static
1147
    {
1148
        $self = clone $this;
×
1149
        $self->routePrefix = $routePrefix;
×
1150

1151
        return $self;
×
1152
    }
1153

1154
    public function getDefaults(): ?array
1155
    {
UNCOV
1156
        return $this->defaults;
68✔
1157
    }
1158

1159
    public function withDefaults(array $defaults): static
1160
    {
1161
        $self = clone $this;
×
1162
        $self->defaults = $defaults;
×
1163

1164
        return $self;
×
1165
    }
1166

1167
    public function getRequirements(): ?array
1168
    {
UNCOV
1169
        return $this->requirements;
68✔
1170
    }
1171

1172
    public function withRequirements(array $requirements): static
1173
    {
1174
        $self = clone $this;
×
1175
        $self->requirements = $requirements;
×
1176

1177
        return $self;
×
1178
    }
1179

1180
    public function getOptions(): ?array
1181
    {
UNCOV
1182
        return $this->options;
68✔
1183
    }
1184

1185
    public function withOptions(array $options): static
1186
    {
1187
        $self = clone $this;
×
1188
        $self->options = $options;
×
1189

1190
        return $self;
×
1191
    }
1192

1193
    public function getStateless(): ?bool
1194
    {
UNCOV
1195
        return $this->stateless;
68✔
1196
    }
1197

1198
    public function withStateless(bool $stateless): static
1199
    {
1200
        $self = clone $this;
×
1201
        $self->stateless = $stateless;
×
1202

1203
        return $self;
×
1204
    }
1205

1206
    public function getSunset(): ?string
1207
    {
UNCOV
1208
        return $this->sunset;
68✔
1209
    }
1210

1211
    public function withSunset(string $sunset): static
1212
    {
1213
        $self = clone $this;
×
1214
        $self->sunset = $sunset;
×
1215

1216
        return $self;
×
1217
    }
1218

1219
    public function getAcceptPatch(): ?string
1220
    {
UNCOV
1221
        return $this->acceptPatch;
68✔
1222
    }
1223

1224
    public function withAcceptPatch(string $acceptPatch): static
1225
    {
1226
        $self = clone $this;
×
1227
        $self->acceptPatch = $acceptPatch;
×
1228

1229
        return $self;
×
1230
    }
1231

1232
    public function getStatus(): ?int
1233
    {
UNCOV
1234
        return $this->status;
87✔
1235
    }
1236

1237
    /**
1238
     * @param int $status
1239
     */
1240
    public function withStatus($status): static
1241
    {
UNCOV
1242
        $self = clone $this;
22✔
UNCOV
1243
        $self->status = $status;
22✔
1244

UNCOV
1245
        return $self;
22✔
1246
    }
1247

1248
    public function getHost(): ?string
1249
    {
UNCOV
1250
        return $this->host;
68✔
1251
    }
1252

1253
    public function withHost(string $host): static
1254
    {
1255
        $self = clone $this;
×
1256
        $self->host = $host;
×
1257

1258
        return $self;
×
1259
    }
1260

1261
    public function getSchemes(): ?array
1262
    {
UNCOV
1263
        return $this->schemes;
68✔
1264
    }
1265

1266
    public function withSchemes(array $schemes): static
1267
    {
1268
        $self = clone $this;
×
1269
        $self->schemes = $schemes;
×
1270

1271
        return $self;
×
1272
    }
1273

1274
    public function getCondition(): ?string
1275
    {
UNCOV
1276
        return $this->condition;
68✔
1277
    }
1278

1279
    public function withCondition(string $condition): static
1280
    {
1281
        $self = clone $this;
×
1282
        $self->condition = $condition;
×
1283

1284
        return $self;
×
1285
    }
1286

1287
    public function getController(): ?string
1288
    {
UNCOV
1289
        return $this->controller;
68✔
1290
    }
1291

1292
    public function withController(string $controller): static
1293
    {
1294
        $self = clone $this;
×
1295
        $self->controller = $controller;
×
1296

1297
        return $self;
×
1298
    }
1299

1300
    public function getHeaders(): ?array
1301
    {
UNCOV
1302
        return $this->headers;
68✔
1303
    }
1304

1305
    public function withHeaders(array $headers): static
1306
    {
1307
        $self = clone $this;
×
1308
        $self->headers = $headers;
×
1309

1310
        return $self;
×
1311
    }
1312

1313
    public function getCacheHeaders(): ?array
1314
    {
UNCOV
1315
        return $this->cacheHeaders;
68✔
1316
    }
1317

1318
    public function withCacheHeaders(array $cacheHeaders): static
1319
    {
UNCOV
1320
        $self = clone $this;
63✔
UNCOV
1321
        $self->cacheHeaders = $cacheHeaders;
63✔
1322

UNCOV
1323
        return $self;
63✔
1324
    }
1325

1326
    /**
1327
     * @return string[]|null
1328
     */
1329
    public function getHydraContext(): ?array
1330
    {
UNCOV
1331
        return $this->hydraContext;
68✔
1332
    }
1333

1334
    public function withHydraContext(array $hydraContext): static
1335
    {
1336
        $self = clone $this;
×
1337
        $self->hydraContext = $hydraContext;
×
1338

1339
        return $self;
×
1340
    }
1341

1342
    public function getOpenapi(): bool|OpenApiOperation|null
1343
    {
UNCOV
1344
        return $this->openapi;
68✔
1345
    }
1346

1347
    public function withOpenapi(bool|OpenApiOperation $openapi): static
1348
    {
1349
        $self = clone $this;
×
1350
        $self->openapi = $openapi;
×
1351

1352
        return $self;
×
1353
    }
1354

1355
    public function getPaginationViaCursor(): ?array
1356
    {
UNCOV
1357
        return $this->paginationViaCursor;
68✔
1358
    }
1359

1360
    public function withPaginationViaCursor(array $paginationViaCursor): static
1361
    {
1362
        $self = clone $this;
×
1363
        $self->paginationViaCursor = $paginationViaCursor;
×
1364

1365
        return $self;
×
1366
    }
1367

1368
    public function getExceptionToStatus(): ?array
1369
    {
UNCOV
1370
        return $this->exceptionToStatus;
68✔
1371
    }
1372

1373
    public function withExceptionToStatus(array $exceptionToStatus): static
1374
    {
1375
        $self = clone $this;
×
1376
        $self->exceptionToStatus = $exceptionToStatus;
×
1377

1378
        return $self;
×
1379
    }
1380

1381
    /**
1382
     * @return GraphQlOperation[]
1383
     */
1384
    public function getGraphQlOperations(): ?array
1385
    {
UNCOV
1386
        return $this->graphQlOperations;
279✔
1387
    }
1388

1389
    public function withGraphQlOperations(array $graphQlOperations): static
1390
    {
UNCOV
1391
        $self = clone $this;
65✔
UNCOV
1392
        $self->graphQlOperations = $graphQlOperations;
65✔
1393

UNCOV
1394
        return $self;
65✔
1395
    }
1396

1397
    public function getLinks(): ?array
1398
    {
UNCOV
1399
        return $this->links;
68✔
1400
    }
1401

1402
    /**
1403
     * @param Link[] $links
1404
     */
1405
    public function withLinks(array $links): static
1406
    {
1407
        $self = clone $this;
×
1408
        $self->links = $links;
×
1409

1410
        return $self;
×
1411
    }
1412
}
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