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

api-platform / core / 15023181448

14 May 2025 02:19PM UTC coverage: 0.0% (-8.4%) from 8.418%
15023181448

Pull #7139

github

web-flow
Merge 9f45709da into 1862d03b7
Pull Request #7139: refactor(symfony): remove obsolete option `validator.query-parameter-validation`

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

11266 existing lines in 366 files now uncovered.

0 of 50828 relevant lines covered (0.0%)

0.0 hits per line

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

0.0
/src/Metadata/Metadata.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\State\OptionsInterface;
17

18
/**
19
 * @internal
20
 */
21
abstract class Metadata
22
{
23
    protected ?Parameters $parameters = null;
24

25
    /**
26
     * @param string|null                                                                       $deprecationReason       https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
27
     * @param string|\Stringable|null                                                           $security                https://api-platform.com/docs/core/security
28
     * @param string|\Stringable|null                                                           $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
29
     * @param mixed|null                                                                        $mercure
30
     * @param mixed|null                                                                        $messenger
31
     * @param mixed|null                                                                        $input
32
     * @param mixed|null                                                                        $output
33
     * @param mixed|null                                                                        $provider
34
     * @param mixed|null                                                                        $processor
35
     * @param Parameters|array<string, Parameter>                                               $parameters
36
     * @param callable|string|array<string, \Illuminate\Contracts\Validation\Rule|array|string> $rules                   Laravel rules can be a FormRequest class, a callable or an array of rules
37
     */
38
    public function __construct(
39
        protected ?string $shortName = null,
40
        protected ?string $class = null,
41
        protected ?string $description = null,
42
        protected ?int $urlGenerationStrategy = null,
43
        protected ?string $deprecationReason = null,
44
        protected ?array $normalizationContext = null,
45
        protected ?array $denormalizationContext = null,
46
        protected ?bool $collectDenormalizationErrors = null,
47
        protected ?array $validationContext = null,
48
        protected ?array $filters = null,
49
        protected ?bool $elasticsearch = null,
50
        protected $mercure = null,
51
        protected $messenger = null,
52
        protected $input = null,
53
        protected $output = null,
54
        protected ?array $order = null,
55
        protected ?bool $fetchPartial = null,
56
        protected ?bool $forceEager = null,
57
        protected ?bool $paginationEnabled = null,
58
        protected ?string $paginationType = null,
59
        protected ?int $paginationItemsPerPage = null,
60
        protected ?int $paginationMaximumItemsPerPage = null,
61
        protected ?bool $paginationPartial = null,
62
        protected ?bool $paginationClientEnabled = null,
63
        protected ?bool $paginationClientItemsPerPage = null,
64
        protected ?bool $paginationClientPartial = null,
65
        protected ?bool $paginationFetchJoinCollection = null,
66
        protected ?bool $paginationUseOutputWalkers = null,
67
        protected string|\Stringable|null $security = null,
68
        protected ?string $securityMessage = null,
69
        protected string|\Stringable|null $securityPostDenormalize = null,
70
        protected ?string $securityPostDenormalizeMessage = null,
71
        protected string|\Stringable|null $securityPostValidation = null,
72
        protected ?string $securityPostValidationMessage = null,
73
        protected $provider = null,
74
        protected $processor = null,
75
        protected ?OptionsInterface $stateOptions = null,
76
        /*
77
         * @experimental
78
         */
79
        array|Parameters|null $parameters = null,
80
        protected mixed $rules = null,
81
        protected ?string $policy = null,
82
        protected array|string|null $middleware = null,
83
        protected ?bool $queryParameterValidationEnabled = null,
84
        protected ?bool $strictQueryParameterValidation = null,
85
        protected ?bool $hideHydraOperation = null,
86
        protected array $extraProperties = [],
87
    ) {
UNCOV
88
        if (\is_array($parameters) && $parameters) {
×
UNCOV
89
            $parameters = new Parameters($parameters);
×
90
        }
91

UNCOV
92
        $this->parameters = $parameters;
×
93
    }
94

95
    public function getShortName(): ?string
96
    {
UNCOV
97
        return $this->shortName;
×
98
    }
99

100
    public function withShortName(string $shortName): static
101
    {
UNCOV
102
        $self = clone $this;
×
UNCOV
103
        $self->shortName = $shortName;
×
104

UNCOV
105
        return $self;
×
106
    }
107

108
    public function getClass(): ?string
109
    {
UNCOV
110
        return $this->class;
×
111
    }
112

113
    public function withClass(string $class): static
114
    {
UNCOV
115
        $self = clone $this;
×
UNCOV
116
        $self->class = $class;
×
117

UNCOV
118
        return $self;
×
119
    }
120

121
    public function getDescription(): ?string
122
    {
UNCOV
123
        return $this->description;
×
124
    }
125

126
    public function withDescription(?string $description = null): static
127
    {
UNCOV
128
        $self = clone $this;
×
UNCOV
129
        $self->description = $description;
×
130

UNCOV
131
        return $self;
×
132
    }
133

134
    public function getUrlGenerationStrategy(): ?int
135
    {
UNCOV
136
        return $this->urlGenerationStrategy;
×
137
    }
138

139
    public function withUrlGenerationStrategy(int $urlGenerationStrategy): static
140
    {
141
        $self = clone $this;
×
142
        $self->urlGenerationStrategy = $urlGenerationStrategy;
×
143

144
        return $self;
×
145
    }
146

147
    public function getDeprecationReason(): ?string
148
    {
UNCOV
149
        return $this->deprecationReason;
×
150
    }
151

152
    public function withDeprecationReason($deprecationReason): static
153
    {
154
        $self = clone $this;
×
155
        $self->deprecationReason = $deprecationReason;
×
156

157
        return $self;
×
158
    }
159

160
    public function getNormalizationContext(): ?array
161
    {
UNCOV
162
        return $this->normalizationContext;
×
163
    }
164

165
    public function withNormalizationContext(array $normalizationContext): static
166
    {
UNCOV
167
        $self = clone $this;
×
UNCOV
168
        $self->normalizationContext = $normalizationContext;
×
169

UNCOV
170
        return $self;
×
171
    }
172

173
    public function getDenormalizationContext(): ?array
174
    {
UNCOV
175
        return $this->denormalizationContext;
×
176
    }
177

178
    public function withDenormalizationContext(array $denormalizationContext): static
179
    {
UNCOV
180
        $self = clone $this;
×
UNCOV
181
        $self->denormalizationContext = $denormalizationContext;
×
182

UNCOV
183
        return $self;
×
184
    }
185

186
    public function getCollectDenormalizationErrors(): ?bool
187
    {
UNCOV
188
        return $this->collectDenormalizationErrors;
×
189
    }
190

191
    public function withCollectDenormalizationErrors(?bool $collectDenormalizationErrors = null): static
192
    {
UNCOV
193
        $self = clone $this;
×
UNCOV
194
        $self->collectDenormalizationErrors = $collectDenormalizationErrors;
×
195

UNCOV
196
        return $self;
×
197
    }
198

199
    public function getValidationContext(): ?array
200
    {
UNCOV
201
        return $this->validationContext;
×
202
    }
203

204
    public function withValidationContext(array $validationContext): static
205
    {
206
        $self = clone $this;
×
207
        $self->validationContext = $validationContext;
×
208

209
        return $self;
×
210
    }
211

212
    /**
213
     * @return string[]|null
214
     */
215
    public function getFilters(): ?array
216
    {
UNCOV
217
        return $this->filters;
×
218
    }
219

220
    public function withFilters(array $filters): static
221
    {
UNCOV
222
        $self = clone $this;
×
UNCOV
223
        $self->filters = $filters;
×
224

UNCOV
225
        return $self;
×
226
    }
227

228
    /**
229
     * @deprecated this will be removed in v4
230
     */
231
    public function getElasticsearch(): ?bool
232
    {
UNCOV
233
        return $this->elasticsearch;
×
234
    }
235

236
    /**
237
     * @deprecated this will be removed in v4
238
     */
239
    public function withElasticsearch(bool $elasticsearch): static
240
    {
241
        $self = clone $this;
×
242
        $self->elasticsearch = $elasticsearch;
×
243

244
        return $self;
×
245
    }
246

247
    /**
248
     * @return array|bool|mixed|null
249
     */
250
    public function getMercure()
251
    {
UNCOV
252
        return $this->mercure;
×
253
    }
254

255
    public function withMercure($mercure): static
256
    {
UNCOV
257
        $self = clone $this;
×
UNCOV
258
        $self->mercure = $mercure;
×
259

UNCOV
260
        return $self;
×
261
    }
262

263
    public function getMessenger()
264
    {
UNCOV
265
        return $this->messenger;
×
266
    }
267

268
    public function withMessenger($messenger): static
269
    {
270
        $self = clone $this;
×
271
        $self->messenger = $messenger;
×
272

273
        return $self;
×
274
    }
275

276
    public function getInput()
277
    {
UNCOV
278
        return $this->input;
×
279
    }
280

281
    public function withInput($input): static
282
    {
UNCOV
283
        $self = clone $this;
×
UNCOV
284
        $self->input = $input;
×
285

UNCOV
286
        return $self;
×
287
    }
288

289
    public function getOutput()
290
    {
UNCOV
291
        return $this->output;
×
292
    }
293

294
    public function withOutput($output): static
295
    {
UNCOV
296
        $self = clone $this;
×
UNCOV
297
        $self->output = $output;
×
298

UNCOV
299
        return $self;
×
300
    }
301

302
    public function getOrder(): ?array
303
    {
UNCOV
304
        return $this->order;
×
305
    }
306

307
    public function withOrder(array $order): static
308
    {
309
        $self = clone $this;
×
310
        $self->order = $order;
×
311

312
        return $self;
×
313
    }
314

315
    public function getFetchPartial(): ?bool
316
    {
UNCOV
317
        return $this->fetchPartial;
×
318
    }
319

320
    public function withFetchPartial(bool $fetchPartial): static
321
    {
322
        $self = clone $this;
×
323
        $self->fetchPartial = $fetchPartial;
×
324

325
        return $self;
×
326
    }
327

328
    public function getForceEager(): ?bool
329
    {
UNCOV
330
        return $this->forceEager;
×
331
    }
332

333
    public function withForceEager(bool $forceEager): static
334
    {
335
        $self = clone $this;
×
336
        $self->forceEager = $forceEager;
×
337

338
        return $self;
×
339
    }
340

341
    public function getPaginationEnabled(): ?bool
342
    {
UNCOV
343
        return $this->paginationEnabled;
×
344
    }
345

346
    public function withPaginationEnabled(bool $paginationEnabled): static
347
    {
348
        $self = clone $this;
×
349
        $self->paginationEnabled = $paginationEnabled;
×
350

351
        return $self;
×
352
    }
353

354
    public function getPaginationType(): ?string
355
    {
UNCOV
356
        return $this->paginationType;
×
357
    }
358

359
    public function withPaginationType(string $paginationType): static
360
    {
361
        $self = clone $this;
×
362
        $self->paginationType = $paginationType;
×
363

364
        return $self;
×
365
    }
366

367
    public function getPaginationItemsPerPage(): ?int
368
    {
UNCOV
369
        return $this->paginationItemsPerPage;
×
370
    }
371

372
    public function withPaginationItemsPerPage(int $paginationItemsPerPage): static
373
    {
UNCOV
374
        $self = clone $this;
×
UNCOV
375
        $self->paginationItemsPerPage = $paginationItemsPerPage;
×
376

UNCOV
377
        return $self;
×
378
    }
379

380
    public function getPaginationMaximumItemsPerPage(): ?int
381
    {
UNCOV
382
        return $this->paginationMaximumItemsPerPage;
×
383
    }
384

385
    public function withPaginationMaximumItemsPerPage(int $paginationMaximumItemsPerPage): static
386
    {
387
        $self = clone $this;
×
388
        $self->paginationMaximumItemsPerPage = $paginationMaximumItemsPerPage;
×
389

390
        return $self;
×
391
    }
392

393
    public function getPaginationPartial(): ?bool
394
    {
UNCOV
395
        return $this->paginationPartial;
×
396
    }
397

398
    public function withPaginationPartial(bool $paginationPartial): static
399
    {
400
        $self = clone $this;
×
401
        $self->paginationPartial = $paginationPartial;
×
402

403
        return $self;
×
404
    }
405

406
    public function getPaginationClientEnabled(): ?bool
407
    {
UNCOV
408
        return $this->paginationClientEnabled;
×
409
    }
410

411
    public function withPaginationClientEnabled(bool $paginationClientEnabled): static
412
    {
UNCOV
413
        $self = clone $this;
×
UNCOV
414
        $self->paginationClientEnabled = $paginationClientEnabled;
×
415

UNCOV
416
        return $self;
×
417
    }
418

419
    public function getPaginationClientItemsPerPage(): ?bool
420
    {
UNCOV
421
        return $this->paginationClientItemsPerPage;
×
422
    }
423

424
    public function withPaginationClientItemsPerPage(bool $paginationClientItemsPerPage): static
425
    {
UNCOV
426
        $self = clone $this;
×
UNCOV
427
        $self->paginationClientItemsPerPage = $paginationClientItemsPerPage;
×
428

UNCOV
429
        return $self;
×
430
    }
431

432
    public function getPaginationClientPartial(): ?bool
433
    {
UNCOV
434
        return $this->paginationClientPartial;
×
435
    }
436

437
    public function withPaginationClientPartial(bool $paginationClientPartial): static
438
    {
UNCOV
439
        $self = clone $this;
×
UNCOV
440
        $self->paginationClientPartial = $paginationClientPartial;
×
441

UNCOV
442
        return $self;
×
443
    }
444

445
    public function getPaginationFetchJoinCollection(): ?bool
446
    {
UNCOV
447
        return $this->paginationFetchJoinCollection;
×
448
    }
449

450
    public function withPaginationFetchJoinCollection(bool $paginationFetchJoinCollection): static
451
    {
452
        $self = clone $this;
×
453
        $self->paginationFetchJoinCollection = $paginationFetchJoinCollection;
×
454

455
        return $self;
×
456
    }
457

458
    public function getPaginationUseOutputWalkers(): ?bool
459
    {
UNCOV
460
        return $this->paginationUseOutputWalkers;
×
461
    }
462

463
    public function withPaginationUseOutputWalkers(bool $paginationUseOutputWalkers): static
464
    {
465
        $self = clone $this;
×
466
        $self->paginationUseOutputWalkers = $paginationUseOutputWalkers;
×
467

468
        return $self;
×
469
    }
470

471
    public function getSecurity(): ?string
472
    {
UNCOV
473
        return $this->security instanceof \Stringable ? (string) $this->security : $this->security;
×
474
    }
475

476
    public function withSecurity($security): static
477
    {
UNCOV
478
        $self = clone $this;
×
UNCOV
479
        $self->security = $security;
×
480

UNCOV
481
        return $self;
×
482
    }
483

484
    public function getSecurityMessage(): ?string
485
    {
UNCOV
486
        return $this->securityMessage;
×
487
    }
488

489
    public function withSecurityMessage(string $securityMessage): static
490
    {
491
        $self = clone $this;
×
492
        $self->securityMessage = $securityMessage;
×
493

494
        return $self;
×
495
    }
496

497
    public function getSecurityPostDenormalize(): ?string
498
    {
UNCOV
499
        return $this->securityPostDenormalize instanceof \Stringable ? (string) $this->securityPostDenormalize : $this->securityPostDenormalize;
×
500
    }
501

502
    public function withSecurityPostDenormalize($securityPostDenormalize): static
503
    {
504
        $self = clone $this;
×
505
        $self->securityPostDenormalize = $securityPostDenormalize;
×
506

507
        return $self;
×
508
    }
509

510
    public function getSecurityPostDenormalizeMessage(): ?string
511
    {
UNCOV
512
        return $this->securityPostDenormalizeMessage;
×
513
    }
514

515
    public function withSecurityPostDenormalizeMessage(string $securityPostDenormalizeMessage): static
516
    {
517
        $self = clone $this;
×
518
        $self->securityPostDenormalizeMessage = $securityPostDenormalizeMessage;
×
519

520
        return $self;
×
521
    }
522

523
    public function getSecurityPostValidation(): ?string
524
    {
UNCOV
525
        return $this->securityPostValidation instanceof \Stringable ? (string) $this->securityPostValidation : $this->securityPostValidation;
×
526
    }
527

528
    public function withSecurityPostValidation(string|\Stringable|null $securityPostValidation = null): static
529
    {
530
        $self = clone $this;
×
531
        $self->securityPostValidation = $securityPostValidation;
×
532

533
        return $self;
×
534
    }
535

536
    public function getSecurityPostValidationMessage(): ?string
537
    {
UNCOV
538
        return $this->securityPostValidationMessage;
×
539
    }
540

541
    public function withSecurityPostValidationMessage(?string $securityPostValidationMessage = null): static
542
    {
543
        $self = clone $this;
×
544
        $self->securityPostValidationMessage = $securityPostValidationMessage;
×
545

546
        return $self;
×
547
    }
548

549
    public function getProcessor(): callable|string|null
550
    {
UNCOV
551
        return $this->processor;
×
552
    }
553

554
    public function withProcessor(callable|string|null $processor): static
555
    {
UNCOV
556
        $self = clone $this;
×
UNCOV
557
        $self->processor = $processor;
×
558

UNCOV
559
        return $self;
×
560
    }
561

562
    public function getProvider(): callable|string|null
563
    {
UNCOV
564
        return $this->provider;
×
565
    }
566

567
    public function withProvider(callable|string|null $provider): static
568
    {
UNCOV
569
        $self = clone $this;
×
UNCOV
570
        $self->provider = $provider;
×
571

UNCOV
572
        return $self;
×
573
    }
574

575
    public function getStateOptions(): ?OptionsInterface
576
    {
UNCOV
577
        return $this->stateOptions;
×
578
    }
579

580
    public function withStateOptions(?OptionsInterface $stateOptions): static
581
    {
UNCOV
582
        $self = clone $this;
×
UNCOV
583
        $self->stateOptions = $stateOptions;
×
584

UNCOV
585
        return $self;
×
586
    }
587

588
    /**
589
     * @return string|callable|array<string, \Illuminate\Contracts\Validation\Rule|array|string>
590
     */
591
    public function getRules(): mixed
592
    {
UNCOV
593
        return $this->rules;
×
594
    }
595

596
    /**
597
     * @param string|callable|array<string, \Illuminate\Contracts\Validation\Rule|array|string> $rules
598
     */
599
    public function withRules(mixed $rules): static
600
    {
601
        $self = clone $this;
×
602
        $self->rules = $rules;
×
603

604
        return $self;
×
605
    }
606

607
    public function getParameters(): ?Parameters
608
    {
UNCOV
609
        return $this->parameters;
×
610
    }
611

612
    public function withParameters(array|Parameters $parameters): static
613
    {
UNCOV
614
        $self = clone $this;
×
UNCOV
615
        $self->parameters = \is_array($parameters) ? new Parameters($parameters) : $parameters;
×
616

UNCOV
617
        return $self;
×
618
    }
619

620
    public function getQueryParameterValidationEnabled(): ?bool
621
    {
UNCOV
622
        return $this->queryParameterValidationEnabled;
×
623
    }
624

625
    public function withQueryParameterValidationEnabled(bool $queryParameterValidationEnabled): static
626
    {
627
        $self = clone $this;
×
628
        $self->queryParameterValidationEnabled = $queryParameterValidationEnabled;
×
629

630
        return $self;
×
631
    }
632

633
    public function getPolicy(): ?string
634
    {
UNCOV
635
        return $this->policy;
×
636
    }
637

638
    public function withPolicy(string $policy): static
639
    {
640
        $self = clone $this;
×
641
        $self->policy = $policy;
×
642

643
        return $self;
×
644
    }
645

646
    public function getMiddleware(): mixed
647
    {
UNCOV
648
        return $this->middleware;
×
649
    }
650

651
    public function withMiddleware(string|array $middleware): static
652
    {
653
        $self = clone $this;
×
654
        $self->middleware = $middleware;
×
655

656
        return $self;
×
657
    }
658

659
    public function getExtraProperties(): ?array
660
    {
UNCOV
661
        return $this->extraProperties;
×
662
    }
663

664
    public function withExtraProperties(array $extraProperties = []): static
665
    {
UNCOV
666
        $self = clone $this;
×
UNCOV
667
        $self->extraProperties = $extraProperties;
×
668

UNCOV
669
        return $self;
×
670
    }
671

672
    public function getStrictQueryParameterValidation(): ?bool
673
    {
UNCOV
674
        return $this->strictQueryParameterValidation;
×
675
    }
676

677
    public function withStrictQueryParameterValidation(bool $strictQueryParameterValidation): static
678
    {
679
        $self = clone $this;
×
680
        $self->strictQueryParameterValidation = $strictQueryParameterValidation;
×
681

682
        return $self;
×
683
    }
684

685
    public function getHideHydraOperation(): ?bool
686
    {
UNCOV
687
        return $this->hideHydraOperation;
×
688
    }
689

690
    public function withHideHydraOperation(bool $hideHydraOperation): static
691
    {
UNCOV
692
        $self = clone $this;
×
UNCOV
693
        $self->hideHydraOperation = $hideHydraOperation;
×
694

UNCOV
695
        return $self;
×
696
    }
697
}
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