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

api-platform / core / 6067528200

04 Sep 2023 12:12AM UTC coverage: 36.875% (-21.9%) from 58.794%
6067528200

Pull #5791

github

web-flow
Merge 64157e578 into d09cfc9d2
Pull Request #5791: fix: strip down any sql function name

3096 of 3096 new or added lines in 205 files covered. (100.0%)

9926 of 26918 relevant lines covered (36.87%)

6.5 hits per line

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

59.24
/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 sharing 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 string|callable|null                                                   $provider
42
     * @param string|callable|null                                                   $processor
43
     * @param mixed|null                                                             $mercure
44
     * @param mixed|null                                                             $messenger
45
     * @param mixed|null                                                             $input
46
     * @param mixed|null                                                             $output
47
     */
48
    public function __construct(
49
        /**
50
         * The URI template represents your resource IRI with optional variables. It follows [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.html).
51
         * API Platform generates this URL for you if you leave this empty.
52
         */
53
        protected ?string $uriTemplate = null,
54

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

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

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

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

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

976
        $this->operations = null === $operations ? null : new Operations($operations);
516✔
977
        $this->provider = $provider;
516✔
978
        $this->processor = $processor;
516✔
979
        if (\is_string($types)) {
516✔
980
            $this->types = (array) $types;
×
981
        }
982
    }
983

984
    public function getOperations(): ?Operations
985
    {
986
        return $this->operations;
558✔
987
    }
988

989
    public function withOperations(Operations $operations): self
990
    {
991
        $self = clone $this;
306✔
992
        $self->operations = $operations;
306✔
993

994
        return $self;
306✔
995
    }
996

997
    public function getUriTemplate(): ?string
998
    {
999
        return $this->uriTemplate;
21✔
1000
    }
1001

1002
    public function withUriTemplate(string $uriTemplate): self
1003
    {
1004
        $self = clone $this;
12✔
1005
        $self->uriTemplate = $uriTemplate;
12✔
1006

1007
        return $self;
12✔
1008
    }
1009

1010
    public function getTypes(): ?array
1011
    {
1012
        return $this->types;
27✔
1013
    }
1014

1015
    /**
1016
     * @param string[]|string $types
1017
     */
1018
    public function withTypes(array|string $types): self
1019
    {
1020
        $self = clone $this;
15✔
1021
        $self->types = (array) $types;
15✔
1022

1023
        return $self;
15✔
1024
    }
1025

1026
    /**
1027
     * @return array|mixed|string|null
1028
     */
1029
    public function getFormats()
1030
    {
1031
        return $this->formats;
21✔
1032
    }
1033

1034
    public function withFormats(mixed $formats): self
1035
    {
1036
        $self = clone $this;
×
1037
        $self->formats = $formats;
×
1038

1039
        return $self;
×
1040
    }
1041

1042
    /**
1043
     * @return array|mixed|string|null
1044
     */
1045
    public function getInputFormats()
1046
    {
1047
        return $this->inputFormats;
21✔
1048
    }
1049

1050
    /**
1051
     * @param mixed|null $inputFormats
1052
     */
1053
    public function withInputFormats($inputFormats): self
1054
    {
1055
        $self = clone $this;
×
1056
        $self->inputFormats = $inputFormats;
×
1057

1058
        return $self;
×
1059
    }
1060

1061
    /**
1062
     * @return array|mixed|string|null
1063
     */
1064
    public function getOutputFormats()
1065
    {
1066
        return $this->outputFormats;
21✔
1067
    }
1068

1069
    /**
1070
     * @param mixed|null $outputFormats
1071
     */
1072
    public function withOutputFormats($outputFormats): self
1073
    {
1074
        $self = clone $this;
×
1075
        $self->outputFormats = $outputFormats;
×
1076

1077
        return $self;
×
1078
    }
1079

1080
    /**
1081
     * @return array<string, Link>|array<string, array>|string[]|string|null
1082
     */
1083
    public function getUriVariables()
1084
    {
1085
        return $this->uriVariables;
21✔
1086
    }
1087

1088
    /**
1089
     * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
1090
     */
1091
    public function withUriVariables($uriVariables): self
1092
    {
1093
        $self = clone $this;
12✔
1094
        $self->uriVariables = $uriVariables;
12✔
1095

1096
        return $self;
12✔
1097
    }
1098

1099
    public function getRoutePrefix(): ?string
1100
    {
1101
        return $this->routePrefix;
21✔
1102
    }
1103

1104
    public function withRoutePrefix(string $routePrefix): self
1105
    {
1106
        $self = clone $this;
×
1107
        $self->routePrefix = $routePrefix;
×
1108

1109
        return $self;
×
1110
    }
1111

1112
    public function getDefaults(): ?array
1113
    {
1114
        return $this->defaults;
21✔
1115
    }
1116

1117
    public function withDefaults(array $defaults): self
1118
    {
1119
        $self = clone $this;
×
1120
        $self->defaults = $defaults;
×
1121

1122
        return $self;
×
1123
    }
1124

1125
    public function getRequirements(): ?array
1126
    {
1127
        return $this->requirements;
21✔
1128
    }
1129

1130
    public function withRequirements(array $requirements): self
1131
    {
1132
        $self = clone $this;
×
1133
        $self->requirements = $requirements;
×
1134

1135
        return $self;
×
1136
    }
1137

1138
    public function getOptions(): ?array
1139
    {
1140
        return $this->options;
21✔
1141
    }
1142

1143
    public function withOptions(array $options): self
1144
    {
1145
        $self = clone $this;
×
1146
        $self->options = $options;
×
1147

1148
        return $self;
×
1149
    }
1150

1151
    public function getStateless(): ?bool
1152
    {
1153
        return $this->stateless;
21✔
1154
    }
1155

1156
    public function withStateless(bool $stateless): self
1157
    {
1158
        $self = clone $this;
×
1159
        $self->stateless = $stateless;
×
1160

1161
        return $self;
×
1162
    }
1163

1164
    public function getSunset(): ?string
1165
    {
1166
        return $this->sunset;
21✔
1167
    }
1168

1169
    public function withSunset(string $sunset): self
1170
    {
1171
        $self = clone $this;
×
1172
        $self->sunset = $sunset;
×
1173

1174
        return $self;
×
1175
    }
1176

1177
    public function getAcceptPatch(): ?string
1178
    {
1179
        return $this->acceptPatch;
21✔
1180
    }
1181

1182
    public function withAcceptPatch(string $acceptPatch): self
1183
    {
1184
        $self = clone $this;
×
1185
        $self->acceptPatch = $acceptPatch;
×
1186

1187
        return $self;
×
1188
    }
1189

1190
    public function getStatus(): ?int
1191
    {
1192
        return $this->status;
21✔
1193
    }
1194

1195
    public function withStatus($status): self
1196
    {
1197
        $self = clone $this;
×
1198
        $self->status = $status;
×
1199

1200
        return $self;
×
1201
    }
1202

1203
    public function getHost(): ?string
1204
    {
1205
        return $this->host;
21✔
1206
    }
1207

1208
    public function withHost(string $host): self
1209
    {
1210
        $self = clone $this;
×
1211
        $self->host = $host;
×
1212

1213
        return $self;
×
1214
    }
1215

1216
    public function getSchemes(): ?array
1217
    {
1218
        return $this->schemes;
21✔
1219
    }
1220

1221
    public function withSchemes(array $schemes): self
1222
    {
1223
        $self = clone $this;
×
1224
        $self->schemes = $schemes;
×
1225

1226
        return $self;
×
1227
    }
1228

1229
    public function getCondition(): ?string
1230
    {
1231
        return $this->condition;
21✔
1232
    }
1233

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

1239
        return $self;
×
1240
    }
1241

1242
    public function getController(): ?string
1243
    {
1244
        return $this->controller;
21✔
1245
    }
1246

1247
    public function withController(string $controller): self
1248
    {
1249
        $self = clone $this;
×
1250
        $self->controller = $controller;
×
1251

1252
        return $self;
×
1253
    }
1254

1255
    public function getCacheHeaders(): ?array
1256
    {
1257
        return $this->cacheHeaders;
21✔
1258
    }
1259

1260
    public function withCacheHeaders(array $cacheHeaders): self
1261
    {
1262
        $self = clone $this;
12✔
1263
        $self->cacheHeaders = $cacheHeaders;
12✔
1264

1265
        return $self;
12✔
1266
    }
1267

1268
    /**
1269
     * @return string[]|null
1270
     */
1271
    public function getHydraContext(): ?array
1272
    {
1273
        return $this->hydraContext;
21✔
1274
    }
1275

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

1281
        return $self;
×
1282
    }
1283

1284
    /**
1285
     * TODO Remove in 4.0.
1286
     *
1287
     * @deprecated
1288
     */
1289
    public function getOpenapiContext(): ?array
1290
    {
1291
        return $this->openapiContext;
21✔
1292
    }
1293

1294
    /**
1295
     * TODO Remove in 4.0.
1296
     *
1297
     * @deprecated
1298
     */
1299
    public function withOpenapiContext(array $openapiContext): self
1300
    {
1301
        $self = clone $this;
×
1302
        $self->openapiContext = $openapiContext;
×
1303

1304
        return $self;
×
1305
    }
1306

1307
    public function getOpenapi(): bool|OpenApiOperation|null
1308
    {
1309
        return $this->openapi;
21✔
1310
    }
1311

1312
    public function withOpenapi(bool|OpenApiOperation $openapi): self
1313
    {
1314
        $self = clone $this;
×
1315
        $self->openapi = $openapi;
×
1316

1317
        return $self;
×
1318
    }
1319

1320
    public function getPaginationViaCursor(): ?array
1321
    {
1322
        return $this->paginationViaCursor;
21✔
1323
    }
1324

1325
    public function withPaginationViaCursor(array $paginationViaCursor): self
1326
    {
1327
        $self = clone $this;
×
1328
        $self->paginationViaCursor = $paginationViaCursor;
×
1329

1330
        return $self;
×
1331
    }
1332

1333
    public function getExceptionToStatus(): ?array
1334
    {
1335
        return $this->exceptionToStatus;
21✔
1336
    }
1337

1338
    public function withExceptionToStatus(array $exceptionToStatus): self
1339
    {
1340
        $self = clone $this;
18✔
1341
        $self->exceptionToStatus = $exceptionToStatus;
18✔
1342

1343
        return $self;
18✔
1344
    }
1345

1346
    public function getQueryParameterValidationEnabled(): ?bool
1347
    {
1348
        return $this->queryParameterValidationEnabled;
21✔
1349
    }
1350

1351
    public function withQueryParameterValidationEnabled(bool $queryParameterValidationEnabled): self
1352
    {
1353
        $self = clone $this;
×
1354
        $self->queryParameterValidationEnabled = $queryParameterValidationEnabled;
×
1355

1356
        return $self;
×
1357
    }
1358

1359
    /**
1360
     * @return GraphQlOperation[]
1361
     */
1362
    public function getGraphQlOperations(): ?array
1363
    {
1364
        return $this->graphQlOperations;
57✔
1365
    }
1366

1367
    public function withGraphQlOperations(array $graphQlOperations): self
1368
    {
1369
        $self = clone $this;
42✔
1370
        $self->graphQlOperations = $graphQlOperations;
42✔
1371

1372
        return $self;
42✔
1373
    }
1374

1375
    public function getLinks(): ?array
1376
    {
1377
        return $this->links;
21✔
1378
    }
1379

1380
    /**
1381
     * @param Link[] $links
1382
     */
1383
    public function withLinks(array $links): self
1384
    {
1385
        $self = clone $this;
×
1386
        $self->links = $links;
×
1387

1388
        return $self;
×
1389
    }
1390
}
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

© 2026 Coveralls, Inc