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

api-platform / core / 15775135891

20 Jun 2025 08:42AM UTC coverage: 22.065% (+0.2%) from 21.876%
15775135891

push

github

soyuka
Merge 4.1

13 of 103 new or added lines in 10 files covered. (12.62%)

868 existing lines in 35 files now uncovered.

11487 of 52060 relevant lines covered (22.06%)

21.72 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 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 $mercure = null,
380
        /**
381
         * The `messenger` option dispatches the current resource through the Message Bus.
382
         *
383
         * <div data-code-selector>
384
         *
385
         * ```php
386
         * <?php
387
         * // api/src/Entity/Book.php
388
         * use ApiPlatform\Metadata\ApiResource;
389
         *
390
         * #[ApiResource(messenger: true)]
391
         * class Book
392
         * {
393
         *     // ...
394
         * }
395
         * ```
396
         *
397
         * ```yaml
398
         * # api/config/api_platform/resources.yaml
399
         * resources:
400
         *     App\Entity\Book:
401
         *         - messenger: true
402
         * ```
403
         *
404
         * ```xml
405
         * <?xml version="1.0" encoding="UTF-8" ?>
406
         * <!-- api/config/api_platform/resources.xml -->
407
         *
408
         * <resources
409
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
410
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
411
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
412
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
413
         *     <resource class="App\Entity\Book" messenger=true />
414
         * </resources>
415
         * ```
416
         *
417
         * </div>
418
         *
419
         * Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
420
         * to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
421
         * and implement your own logic.
422
         *
423
         * Read [how to use Messenger with an Input object](/docs/guide/using-messenger-with-an-input-object).
424
         *
425
         * @var string|bool|null
426
         */
427
        protected $messenger = null,
428
        protected $input = null,
429
        protected $output = null,
430
        /**
431
         * Override the default order of items in your collection. Note that this is handled by our doctrine filters such as
432
         * the [OrderFilter](/docs/reference/Doctrine/Orm/Filter/OrderFilter).
433
         *
434
         * By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
435
         * customize this order, you must add an `order` attribute on your ApiResource annotation:
436
         *
437
         * <div data-code-selector>
438
         *
439
         * ```php
440
         * <?php
441
         * // api/src/Entity/Book.php
442
         * namespace App\Entity;
443
         *
444
         * use ApiPlatform\Metadata\ApiResource;
445
         *
446
         * #[ApiResource(order: ['foo' => 'ASC'])]
447
         * class Book
448
         * {
449
         * }
450
         * ```
451
         *
452
         * ```yaml
453
         * # api/config/api_platform/resources/Book.yaml
454
         * App\Entity\Book:
455
         *     order:
456
         *         foo: ASC
457
         * ```
458
         *
459
         * </div>
460
         *
461
         * This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
462
         * If you only specify the key, `ASC` direction will be used as default.
463
         */
464
        protected ?array $order = null,
465
        protected ?bool $fetchPartial = null,
466
        protected ?bool $forceEager = null,
467
        /**
468
         * The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
469
         *
470
         * <div data-code-selector>
471
         *
472
         * ```php
473
         * <?php
474
         * // api/src/Entity/Book.php
475
         * use ApiPlatform\Metadata\ApiResource;
476
         *
477
         * #[ApiResource(paginationClientEnabled: true)]
478
         * class Book
479
         * {
480
         *     // ...
481
         * }
482
         * ```
483
         *
484
         * ```yaml
485
         * # api/config/api_platform/resources.yaml
486
         * resources:
487
         *     App\Entity\Book:
488
         *         - paginationClientEnabled: true
489
         * ```
490
         *
491
         * ```xml
492
         * <?xml version="1.0" encoding="UTF-8" ?>
493
         * <!-- api/config/api_platform/resources.xml -->
494
         *
495
         * <resources
496
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
497
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
498
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
499
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
500
         *     <resource class="App\Entity\Book" paginationClientEnabled=true />
501
         * </resources>
502
         * ```
503
         *
504
         * </div>
505
         *
506
         * The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
507
         * - `GET /books?pagination=false`: disabled
508
         * - `GET /books?pagination=true`: enabled
509
         */
510
        protected ?bool $paginationClientEnabled = null,
511
        /**
512
         * The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
513
         *
514
         * <div data-code-selector>
515
         *
516
         * ```php
517
         * <?php
518
         * // api/src/Entity/Book.php
519
         * use ApiPlatform\Metadata\ApiResource;
520
         *
521
         * #[ApiResource(paginationClientItemsPerPage: true)]
522
         * class Book
523
         * {
524
         *     // ...
525
         * }
526
         * ```
527
         *
528
         * ```yaml
529
         * # api/config/api_platform/resources.yaml
530
         * resources:
531
         *     App\Entity\Book:
532
         *         - paginationClientItemsPerPage: true
533
         * ```
534
         *
535
         * ```xml
536
         * <?xml version="1.0" encoding="UTF-8" ?>
537
         * <!-- api/config/api_platform/resources.xml -->
538
         *
539
         * <resources
540
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
541
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
542
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
543
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
544
         *     <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
545
         * </resources>
546
         * ```
547
         *
548
         * </div>
549
         *
550
         * The number of items can now be set by adding a query parameter named `itemsPerPage`:
551
         * - `GET /books?itemsPerPage=50`
552
         */
553
        protected ?bool $paginationClientItemsPerPage = null,
554
        /**
555
         * The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
556
         *
557
         * <div data-code-selector>
558
         *
559
         * ```php
560
         * <?php
561
         * // api/src/Entity/Book.php
562
         * use ApiPlatform\Metadata\ApiResource;
563
         *
564
         * #[ApiResource(paginationClientPartial: true)]
565
         * class Book
566
         * {
567
         *     // ...
568
         * }
569
         * ```
570
         *
571
         * ```yaml
572
         * # api/config/api_platform/resources.yaml
573
         * resources:
574
         *     App\Entity\Book:
575
         *         - paginationClientPartial: true
576
         * ```
577
         *
578
         * ```xml
579
         * <?xml version="1.0" encoding="UTF-8" ?>
580
         * <!-- api/config/api_platform/resources.xml -->
581
         *
582
         * <resources
583
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
584
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
585
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
586
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
587
         *     <resource class="App\Entity\Book" paginationClientPartial=true />
588
         * </resources>
589
         * ```
590
         *
591
         * </div>
592
         *
593
         * The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
594
         * - `GET /books?partial=false`: disabled
595
         * - `GET /books?partial=true`: enabled
596
         */
597
        protected ?bool $paginationClientPartial = null,
598
        /**
599
         * The `paginationViaCursor` option configures the cursor-based pagination for the current resource.
600
         * Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
601
         * Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
602
         *
603
         * <div data-code-selector>
604
         *
605
         * ```php
606
         * <?php
607
         * // api/src/Entity/Book.php
608
         * use ApiPlatform\Metadata\ApiFilter;
609
         * use ApiPlatform\Metadata\ApiResource;
610
         * use ApiPlatform\Doctrine\Odm\Filter\OrderFilter;
611
         * use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
612
         *
613
         * #[ApiResource(paginationPartial: true, paginationViaCursor: [['field' => 'id', 'direction' => 'DESC']])]
614
         * #[ApiFilter(RangeFilter::class, properties: ["id"])]
615
         * #[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])]
616
         * class Book
617
         * {
618
         *     // ...
619
         * }
620
         * ```
621
         *
622
         * ```yaml
623
         * # api/config/api_platform/resources.yaml
624
         * resources:
625
         *     App\Entity\Book:
626
         *         - paginationPartial: true
627
         *           paginationViaCursor:
628
         *               - { field: 'id', direction: 'DESC' }
629
         *           filters: [ 'app.filters.book.range', 'app.filters.book.order' ]
630
         * ```
631
         *
632
         * ```xml
633
         * <?xml version="1.0" encoding="UTF-8" ?>
634
         * <!-- api/config/api_platform/resources.xml -->
635
         *
636
         * <resources
637
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
638
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
639
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
640
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
641
         *     <resource class="App\Entity\Book" paginationPartial=true>
642
         *         <filters>
643
         *             <filter>app.filters.book.range</filter>
644
         *             <filter>app.filters.book.order</filter>
645
         *         </filters>
646
         *         <paginationViaCursor>
647
         *             <paginationField field="id" direction="DESC" />
648
         *         </paginationViaCursor>
649
         *     </resource>
650
         * </resources>
651
         * ```
652
         *
653
         * </div>
654
         *
655
         * To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
656
         */
657
        protected ?array $paginationViaCursor = null,
658
        /**
659
         * The `paginationEnabled` option enables (or disables) the pagination for the current resource.
660
         *
661
         * <div data-code-selector>
662
         *
663
         * ```php
664
         * <?php
665
         * // api/src/Entity/Book.php
666
         * use ApiPlatform\Metadata\ApiResource;
667
         *
668
         * #[ApiResource(paginationEnabled: true)]
669
         * class Book
670
         * {
671
         *     // ...
672
         * }
673
         * ```
674
         *
675
         * ```yaml
676
         * # api/config/api_platform/resources.yaml
677
         * resources:
678
         *     App\Entity\Book:
679
         *         - paginationEnabled: true
680
         * ```
681
         *
682
         * ```xml
683
         * <?xml version="1.0" encoding="UTF-8" ?>
684
         * <!-- api/config/api_platform/resources.xml -->
685
         *
686
         * <resources
687
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
688
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
689
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
690
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
691
         *     <resource class="App\Entity\Book" paginationEnabled=true />
692
         * </resources>
693
         * ```
694
         *
695
         * </div>
696
         */
697
        protected ?bool $paginationEnabled = null,
698
        /**
699
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
700
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$fetchJoinCollection`
701
         * argument, whether there is a join to a collection-valued association.
702
         *
703
         * When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
704
         * correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
705
         *
706
         * <div data-code-selector>
707
         *
708
         * ```php
709
         * <?php
710
         * // api/src/Entity/Book.php
711
         * use ApiPlatform\Metadata\ApiResource;
712
         *
713
         * #[ApiResource(paginationFetchJoinCollection: false)]
714
         * class Book
715
         * {
716
         *     // ...
717
         * }
718
         * ```
719
         *
720
         * ```yaml
721
         * # api/config/api_platform/resources.yaml
722
         * resources:
723
         *     App\Entity\Book:
724
         *         - paginationFetchJoinCollection: false
725
         * ```
726
         *
727
         * ```xml
728
         * <?xml version="1.0" encoding="UTF-8" ?>
729
         * <!-- api/config/api_platform/resources.xml -->
730
         *
731
         * <resources
732
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
733
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
734
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
735
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
736
         *     <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
737
         * </resources>
738
         * ```
739
         *
740
         * </div>
741
         *
742
         * 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.
743
         */
744
        protected ?bool $paginationFetchJoinCollection = null,
745
        /**
746
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
747
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$setUseOutputWalkers` setter,
748
         * whether to use output walkers.
749
         *
750
         * When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
751
         * of queries. You can configure this using the `paginationUseOutputWalkers` option:
752
         *
753
         * <div data-code-selector>
754
         *
755
         * ```php
756
         * <?php
757
         * // api/src/Entity/Book.php
758
         * use ApiPlatform\Metadata\ApiResource;
759
         *
760
         * #[ApiResource(paginationUseOutputWalkers: false)]
761
         * class Book
762
         * {
763
         *     // ...
764
         * }
765
         * ```
766
         *
767
         * ```yaml
768
         * # api/config/api_platform/resources.yaml
769
         * resources:
770
         *     App\Entity\Book:
771
         *         - paginationUseOutputWalkers: false
772
         * ```
773
         *
774
         * ```xml
775
         * <?xml version="1.0" encoding="UTF-8" ?>
776
         * <!-- api/config/api_platform/resources.xml -->
777
         * <resources
778
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
779
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
780
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
781
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
782
         *     <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
783
         * </resources>
784
         * ```
785
         *
786
         * </div>
787
         *
788
         * 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.
789
         */
790
        protected ?bool $paginationUseOutputWalkers = null,
791
        /**
792
         * The `paginationItemsPerPage` option defines the number of items per page for the current resource.
793
         *
794
         * <div data-code-selector>
795
         *
796
         * ```php
797
         * <?php
798
         * // api/src/Entity/Book.php
799
         * use ApiPlatform\Metadata\ApiResource;
800
         *
801
         * #[ApiResource(paginationItemsPerPage: 30)]
802
         * class Book
803
         * {
804
         *     // ...
805
         * }
806
         * ```
807
         *
808
         * ```yaml
809
         * # api/config/api_platform/resources.yaml
810
         * resources:
811
         *     App\Entity\Book:
812
         *         - paginationItemsPerPage: 30
813
         * ```
814
         *
815
         * ```xml
816
         * <?xml version="1.0" encoding="UTF-8" ?>
817
         * <!-- api/config/api_platform/resources.xml -->
818
         * <resources
819
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
820
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
821
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
822
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
823
         *     <resource class="App\Entity\Book" paginationItemsPerPage=30 />
824
         * </resources>
825
         * ```
826
         *
827
         * </div>
828
         */
829
        protected ?int $paginationItemsPerPage = null,
830
        /**
831
         * The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
832
         *
833
         * <div data-code-selector>
834
         *
835
         * ```php
836
         * <?php
837
         * // api/src/Entity/Book.php
838
         * use ApiPlatform\Metadata\ApiResource;
839
         *
840
         * #[ApiResource(paginationMaximumItemsPerPage: 50)]
841
         * class Book
842
         * {
843
         *     // ...
844
         * }
845
         * ```
846
         *
847
         * ```yaml
848
         * # api/config/api_platform/resources.yaml
849
         * resources:
850
         *     App\Entity\Book:
851
         *         - paginationMaximumItemsPerPage: 50
852
         * ```
853
         *
854
         * ```xml
855
         * <?xml version="1.0" encoding="UTF-8" ?>
856
         * <!-- api/config/api_platform/resources.xml -->
857
         * <resources
858
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
859
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
860
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
861
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
862
         *     <resource class="App\Entity\Book" paginationMaximumItemsPerPage=50 />
863
         * </resources>
864
         * ```
865
         *
866
         * </div>
867
         */
868
        protected ?int $paginationMaximumItemsPerPage = null,
869
        /**
870
         * The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
871
         *
872
         * <div data-code-selector>
873
         *
874
         * ```php
875
         * <?php
876
         * // api/src/Entity/Book.php
877
         * use ApiPlatform\Metadata\ApiResource;
878
         *
879
         * #[ApiResource(paginationPartial: true)]
880
         * class Book
881
         * {
882
         *     // ...
883
         * }
884
         * ```
885
         *
886
         * ```yaml
887
         * # api/config/api_platform/resources.yaml
888
         * resources:
889
         *     App\Entity\Book:
890
         *         - paginationPartial: true
891
         * ```
892
         *
893
         * ```xml
894
         * <?xml version="1.0" encoding="UTF-8" ?>
895
         * <!-- api/config/api_platform/resources.xml -->
896
         * <resources
897
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
898
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
899
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
900
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
901
         *     <resource class="App\Entity\Book" paginationPartial=true />
902
         * </resources>
903
         * ```
904
         *
905
         * </div>
906
         */
907
        protected ?bool $paginationPartial = null,
908
        /**
909
         * The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
910
         *
911
         * <div data-code-selector>
912
         *
913
         * ```php
914
         * <?php
915
         * // api/src/Entity/Book.php
916
         * use ApiPlatform\Metadata\ApiResource;
917
         *
918
         * #[ApiResource(paginationType: 'page')]
919
         * class Book
920
         * {
921
         *     // ...
922
         * }
923
         * ```
924
         *
925
         * ```yaml
926
         * # api/config/api_platform/resources.yaml
927
         * resources:
928
         *     App\Entity\Book:
929
         *         - paginationType: page
930
         * ```
931
         *
932
         * ```xml
933
         * <?xml version="1.0" encoding="UTF-8" ?>
934
         * <!-- api/config/api_platform/resources.xml -->
935
         * <resources
936
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
937
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
938
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
939
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
940
         *     <resource class="App\Entity\Book" paginationType="page" />
941
         * </resources>
942
         * ```
943
         *
944
         * </div>
945
         */
946
        protected ?string $paginationType = null,
947
        protected string|\Stringable|null $security = null,
948
        protected ?string $securityMessage = null,
949
        protected string|\Stringable|null $securityPostDenormalize = null,
950
        protected ?string $securityPostDenormalizeMessage = null,
951
        protected string|\Stringable|null $securityPostValidation = null,
952
        protected ?string $securityPostValidationMessage = null,
953
        protected ?bool $compositeIdentifier = null,
954
        protected ?array $exceptionToStatus = null,
955
        protected ?bool $queryParameterValidationEnabled = null,
956
        protected ?array $links = null,
957
        protected ?array $graphQlOperations = null,
958
        $provider = null,
959
        $processor = null,
960
        protected ?OptionsInterface $stateOptions = null,
961
        protected mixed $rules = null,
962
        ?string $policy = null,
963
        array|string|null $middleware = null,
964
        array|Parameters|null $parameters = null,
965
        protected ?bool $strictQueryParameterValidation = null,
966
        protected ?bool $hideHydraOperation = null,
967
        protected array $extraProperties = [],
968
    ) {
969
        parent::__construct(
214✔
970
            shortName: $shortName,
214✔
971
            class: $class,
214✔
972
            description: $description,
214✔
973
            urlGenerationStrategy: $urlGenerationStrategy,
214✔
974
            deprecationReason: $deprecationReason,
214✔
975
            normalizationContext: $normalizationContext,
214✔
976
            denormalizationContext: $denormalizationContext,
214✔
977
            collectDenormalizationErrors: $collectDenormalizationErrors,
214✔
978
            validationContext: $validationContext,
214✔
979
            filters: $filters,
214✔
980
            mercure: $mercure,
214✔
981
            messenger: $messenger,
214✔
982
            input: $input,
214✔
983
            output: $output,
214✔
984
            order: $order,
214✔
985
            fetchPartial: $fetchPartial,
214✔
986
            forceEager: $forceEager,
214✔
987
            paginationEnabled: $paginationEnabled,
214✔
988
            paginationType: $paginationType,
214✔
989
            paginationItemsPerPage: $paginationItemsPerPage,
214✔
990
            paginationMaximumItemsPerPage: $paginationMaximumItemsPerPage,
214✔
991
            paginationPartial: $paginationPartial,
214✔
992
            paginationClientEnabled: $paginationClientEnabled,
214✔
993
            paginationClientItemsPerPage: $paginationClientItemsPerPage,
214✔
994
            paginationClientPartial: $paginationClientPartial,
214✔
995
            paginationFetchJoinCollection: $paginationFetchJoinCollection,
214✔
996
            paginationUseOutputWalkers: $paginationUseOutputWalkers,
214✔
997
            security: $security,
214✔
998
            securityMessage: $securityMessage,
214✔
999
            securityPostDenormalize: $securityPostDenormalize,
214✔
1000
            securityPostDenormalizeMessage: $securityPostDenormalizeMessage,
214✔
1001
            securityPostValidation: $securityPostValidation,
214✔
1002
            securityPostValidationMessage: $securityPostValidationMessage,
214✔
1003
            provider: $provider,
214✔
1004
            processor: $processor,
214✔
1005
            stateOptions: $stateOptions,
214✔
1006
            parameters: $parameters,
214✔
1007
            rules: $rules,
214✔
1008
            policy: $policy,
214✔
1009
            middleware: $middleware,
214✔
1010
            strictQueryParameterValidation: $strictQueryParameterValidation,
214✔
1011
            hideHydraOperation: $hideHydraOperation,
214✔
1012
            extraProperties: $extraProperties
214✔
1013
        );
214✔
1014

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

1023
    public function getOperations(): ?Operations
1024
    {
1025
        return $this->operations;
676✔
1026
    }
1027

1028
    public function withOperations(Operations $operations): static
1029
    {
1030
        $self = clone $this;
188✔
1031
        $self->operations = $operations;
188✔
1032
        $self->operations->sort();
188✔
1033

1034
        return $self;
188✔
1035
    }
1036

1037
    public function getUriTemplate(): ?string
1038
    {
1039
        return $this->uriTemplate;
102✔
1040
    }
1041

1042
    public function withUriTemplate(string $uriTemplate): static
1043
    {
UNCOV
1044
        $self = clone $this;
×
UNCOV
1045
        $self->uriTemplate = $uriTemplate;
×
1046

1047
        return $self;
×
1048
    }
1049

1050
    public function getTypes(): ?array
1051
    {
1052
        return $this->types;
102✔
1053
    }
1054

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

1063
        return $self;
4✔
1064
    }
1065

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

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

1079
        return $self;
×
1080
    }
1081

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

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

1098
        return $self;
×
1099
    }
1100

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

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

1117
        return $self;
×
1118
    }
1119

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

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

1136
        return $self;
96✔
1137
    }
1138

1139
    public function getRoutePrefix(): ?string
1140
    {
1141
        return $this->routePrefix;
102✔
1142
    }
1143

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

1149
        return $self;
×
1150
    }
1151

1152
    public function getDefaults(): ?array
1153
    {
1154
        return $this->defaults;
102✔
1155
    }
1156

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

1162
        return $self;
×
1163
    }
1164

1165
    public function getRequirements(): ?array
1166
    {
1167
        return $this->requirements;
102✔
1168
    }
1169

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

1175
        return $self;
×
1176
    }
1177

1178
    public function getOptions(): ?array
1179
    {
1180
        return $this->options;
102✔
1181
    }
1182

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

1188
        return $self;
×
1189
    }
1190

1191
    public function getStateless(): ?bool
1192
    {
1193
        return $this->stateless;
102✔
1194
    }
1195

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

1201
        return $self;
×
1202
    }
1203

1204
    public function getSunset(): ?string
1205
    {
1206
        return $this->sunset;
102✔
1207
    }
1208

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

1214
        return $self;
×
1215
    }
1216

1217
    public function getAcceptPatch(): ?string
1218
    {
1219
        return $this->acceptPatch;
102✔
1220
    }
1221

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

1227
        return $self;
×
1228
    }
1229

1230
    public function getStatus(): ?int
1231
    {
1232
        return $this->status;
118✔
1233
    }
1234

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

1243
        return $self;
22✔
1244
    }
1245

1246
    public function getHost(): ?string
1247
    {
1248
        return $this->host;
102✔
1249
    }
1250

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

1256
        return $self;
×
1257
    }
1258

1259
    public function getSchemes(): ?array
1260
    {
1261
        return $this->schemes;
102✔
1262
    }
1263

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

1269
        return $self;
×
1270
    }
1271

1272
    public function getCondition(): ?string
1273
    {
1274
        return $this->condition;
102✔
1275
    }
1276

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

1282
        return $self;
×
1283
    }
1284

1285
    public function getController(): ?string
1286
    {
1287
        return $this->controller;
102✔
1288
    }
1289

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

1295
        return $self;
×
1296
    }
1297

1298
    public function getHeaders(): ?array
1299
    {
1300
        return $this->headers;
102✔
1301
    }
1302

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

1308
        return $self;
×
1309
    }
1310

1311
    public function getCacheHeaders(): ?array
1312
    {
1313
        return $this->cacheHeaders;
102✔
1314
    }
1315

1316
    public function withCacheHeaders(array $cacheHeaders): static
1317
    {
1318
        $self = clone $this;
96✔
1319
        $self->cacheHeaders = $cacheHeaders;
96✔
1320

1321
        return $self;
96✔
1322
    }
1323

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

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

1337
        return $self;
×
1338
    }
1339

1340
    public function getOpenapi(): bool|OpenApiOperation|null
1341
    {
1342
        return $this->openapi;
100✔
1343
    }
1344

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

1350
        return $self;
×
1351
    }
1352

1353
    public function getPaginationViaCursor(): ?array
1354
    {
1355
        return $this->paginationViaCursor;
102✔
1356
    }
1357

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

1363
        return $self;
×
1364
    }
1365

1366
    public function getExceptionToStatus(): ?array
1367
    {
1368
        return $this->exceptionToStatus;
102✔
1369
    }
1370

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

1376
        return $self;
×
1377
    }
1378

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

1387
    public function withGraphQlOperations(array $graphQlOperations): static
1388
    {
1389
        $self = clone $this;
96✔
1390
        $self->graphQlOperations = $graphQlOperations;
96✔
1391

1392
        return $self;
96✔
1393
    }
1394

1395
    public function getLinks(): ?array
1396
    {
1397
        return $this->links;
102✔
1398
    }
1399

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

1408
        return $self;
×
1409
    }
1410
}
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