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

api-platform / core / 16050929464

03 Jul 2025 12:51PM UTC coverage: 22.065% (+0.2%) from 21.821%
16050929464

push

github

soyuka
chore: todo improvement

11516 of 52192 relevant lines covered (22.06%)

22.08 hits per line

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

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

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Metadata;
15

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

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

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

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

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

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

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

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

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

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

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

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

1045
        return $self;
192✔
1046
    }
1047

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

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

1058
        return $self;
×
1059
    }
1060

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

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

1074
        return $self;
4✔
1075
    }
1076

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

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

1090
        return $self;
×
1091
    }
1092

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

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

1109
        return $self;
×
1110
    }
1111

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

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

1128
        return $self;
×
1129
    }
1130

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

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

1147
        return $self;
100✔
1148
    }
1149

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

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

1160
        return $self;
×
1161
    }
1162

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

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

1173
        return $self;
×
1174
    }
1175

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

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

1186
        return $self;
×
1187
    }
1188

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

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

1199
        return $self;
×
1200
    }
1201

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

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

1212
        return $self;
×
1213
    }
1214

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

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

1225
        return $self;
×
1226
    }
1227

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

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

1238
        return $self;
×
1239
    }
1240

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

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

1254
        return $self;
22✔
1255
    }
1256

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

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

1267
        return $self;
×
1268
    }
1269

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

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

1280
        return $self;
×
1281
    }
1282

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

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

1293
        return $self;
×
1294
    }
1295

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

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

1306
        return $self;
×
1307
    }
1308

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

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

1319
        return $self;
×
1320
    }
1321

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

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

1332
        return $self;
100✔
1333
    }
1334

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

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

1348
        return $self;
×
1349
    }
1350

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

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

1361
        return $self;
×
1362
    }
1363

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

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

1374
        return $self;
×
1375
    }
1376

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

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

1387
        return $self;
×
1388
    }
1389

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

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

1403
        return $self;
100✔
1404
    }
1405

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

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

1419
        return $self;
×
1420
    }
1421
}
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