• 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

72.55
/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
    /**
24
     * @param string|null $deprecationReason       https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
25
     * @param string|null $security                https://api-platform.com/docs/core/security
26
     * @param string|null $securityPostDenormalize https://api-platform.com/docs/core/security/#executing-access-control-rules-after-denormalization
27
     * @param mixed|null  $mercure
28
     * @param mixed|null  $messenger
29
     * @param mixed|null  $input
30
     * @param mixed|null  $output
31
     * @param mixed|null  $provider
32
     * @param mixed|null  $processor
33
     */
34
    public function __construct(
35
        protected ?string $shortName = null,
36
        protected ?string $class = null,
37
        protected ?string $description = null,
38
        protected ?int $urlGenerationStrategy = null,
39
        protected ?string $deprecationReason = null,
40
        protected ?array $normalizationContext = null,
41
        protected ?array $denormalizationContext = null,
42
        protected ?bool $collectDenormalizationErrors = null,
43
        protected ?array $validationContext = null,
44
        protected ?array $filters = null,
45
        protected ?bool $elasticsearch = null,
46
        protected $mercure = null,
47
        protected $messenger = null,
48
        protected $input = null,
49
        protected $output = null,
50
        protected ?array $order = null,
51
        protected ?bool $fetchPartial = null,
52
        protected ?bool $forceEager = null,
53
        protected ?bool $paginationEnabled = null,
54
        protected ?string $paginationType = null,
55
        protected ?int $paginationItemsPerPage = null,
56
        protected ?int $paginationMaximumItemsPerPage = null,
57
        protected ?bool $paginationPartial = null,
58
        protected ?bool $paginationClientEnabled = null,
59
        protected ?bool $paginationClientItemsPerPage = null,
60
        protected ?bool $paginationClientPartial = null,
61
        protected ?bool $paginationFetchJoinCollection = null,
62
        protected ?bool $paginationUseOutputWalkers = null,
63
        protected ?string $security = null,
64
        protected ?string $securityMessage = null,
65
        protected ?string $securityPostDenormalize = null,
66
        protected ?string $securityPostDenormalizeMessage = null,
67
        protected ?string $securityPostValidation = null,
68
        protected ?string $securityPostValidationMessage = null,
69
        protected $provider = null,
70
        protected $processor = null,
71
        protected ?OptionsInterface $stateOptions = null,
72
        protected array $extraProperties = []
73
    ) {
74
    }
923✔
75

76
    public function getShortName(): ?string
77
    {
78
        return $this->shortName;
210✔
79
    }
80

81
    public function withShortName(string $shortName): static
82
    {
83
        $self = clone $this;
201✔
84
        $self->shortName = $shortName;
201✔
85

86
        return $self;
201✔
87
    }
88

89
    public function getClass(): ?string
90
    {
91
        return $this->class;
219✔
92
    }
93

94
    public function withClass(string $class): static
95
    {
96
        $self = clone $this;
94✔
97
        $self->class = $class;
94✔
98

99
        return $self;
94✔
100
    }
101

102
    public function getDescription(): ?string
103
    {
104
        return $this->description;
87✔
105
    }
106

107
    public function withDescription(string $description = null): static
108
    {
109
        $self = clone $this;
24✔
110
        $self->description = $description;
24✔
111

112
        return $self;
24✔
113
    }
114

115
    public function getUrlGenerationStrategy(): ?int
116
    {
117
        return $this->urlGenerationStrategy;
132✔
118
    }
119

120
    public function withUrlGenerationStrategy(int $urlGenerationStrategy): static
121
    {
122
        $self = clone $this;
3✔
123
        $self->urlGenerationStrategy = $urlGenerationStrategy;
3✔
124

125
        return $self;
3✔
126
    }
127

128
    public function getDeprecationReason(): ?string
129
    {
130
        return $this->deprecationReason;
87✔
131
    }
132

133
    public function withDeprecationReason($deprecationReason): static
134
    {
135
        $self = clone $this;
3✔
136
        $self->deprecationReason = $deprecationReason;
3✔
137

138
        return $self;
3✔
139
    }
140

141
    public function getNormalizationContext(): ?array
142
    {
143
        return $this->normalizationContext;
216✔
144
    }
145

146
    public function withNormalizationContext(array $normalizationContext): static
147
    {
148
        $self = clone $this;
27✔
149
        $self->normalizationContext = $normalizationContext;
27✔
150

151
        return $self;
27✔
152
    }
153

154
    public function getDenormalizationContext(): ?array
155
    {
156
        return $this->denormalizationContext;
171✔
157
    }
158

159
    public function withDenormalizationContext(array $denormalizationContext): static
160
    {
161
        $self = clone $this;
3✔
162
        $self->denormalizationContext = $denormalizationContext;
3✔
163

164
        return $self;
3✔
165
    }
166

167
    public function getCollectDenormalizationErrors(): ?bool
168
    {
169
        return $this->collectDenormalizationErrors;
96✔
170
    }
171

172
    public function withCollectDenormalizationErrors(bool $collectDenormalizationErrors = null): static
173
    {
174
        $self = clone $this;
3✔
175
        $self->collectDenormalizationErrors = $collectDenormalizationErrors;
3✔
176

177
        return $self;
3✔
178
    }
179

180
    public function getValidationContext(): ?array
181
    {
182
        return $this->validationContext;
114✔
183
    }
184

185
    public function withValidationContext(array $validationContext): static
186
    {
187
        $self = clone $this;
×
188
        $self->validationContext = $validationContext;
×
189

190
        return $self;
×
191
    }
192

193
    /**
194
     * @return string[]|null
195
     */
196
    public function getFilters(): ?array
197
    {
198
        return $this->filters;
141✔
199
    }
200

201
    public function withFilters(array $filters): static
202
    {
203
        $self = clone $this;
30✔
204
        $self->filters = $filters;
30✔
205

206
        return $self;
30✔
207
    }
208

209
    /**
210
     * @deprecated this will be removed in v4
211
     */
212
    public function getElasticsearch(): ?bool
213
    {
214
        return $this->elasticsearch;
21✔
215
    }
216

217
    /**
218
     * @deprecated this will be removed in v4
219
     */
220
    public function withElasticsearch(bool $elasticsearch): static
221
    {
222
        $self = clone $this;
×
223
        $self->elasticsearch = $elasticsearch;
×
224

225
        return $self;
×
226
    }
227

228
    /**
229
     * @return array|bool|mixed|null
230
     */
231
    public function getMercure()
232
    {
233
        return $this->mercure;
111✔
234
    }
235

236
    public function withMercure($mercure): static
237
    {
238
        $self = clone $this;
9✔
239
        $self->mercure = $mercure;
9✔
240

241
        return $self;
9✔
242
    }
243

244
    public function getMessenger()
245
    {
246
        return $this->messenger;
21✔
247
    }
248

249
    public function withMessenger($messenger): static
250
    {
251
        $self = clone $this;
×
252
        $self->messenger = $messenger;
×
253

254
        return $self;
×
255
    }
256

257
    public function getInput()
258
    {
259
        return $this->input;
111✔
260
    }
261

262
    public function withInput($input): static
263
    {
264
        $self = clone $this;
57✔
265
        $self->input = $input;
57✔
266

267
        return $self;
57✔
268
    }
269

270
    public function getOutput()
271
    {
272
        return $this->output;
150✔
273
    }
274

275
    public function withOutput($output): static
276
    {
277
        $self = clone $this;
18✔
278
        $self->output = $output;
18✔
279

280
        return $self;
18✔
281
    }
282

283
    public function getOrder(): ?array
284
    {
285
        return $this->order;
54✔
286
    }
287

288
    public function withOrder(array $order): static
289
    {
290
        $self = clone $this;
3✔
291
        $self->order = $order;
3✔
292

293
        return $self;
3✔
294
    }
295

296
    public function getFetchPartial(): ?bool
297
    {
298
        return $this->fetchPartial;
102✔
299
    }
300

301
    public function withFetchPartial(bool $fetchPartial): static
302
    {
303
        $self = clone $this;
×
304
        $self->fetchPartial = $fetchPartial;
×
305

306
        return $self;
×
307
    }
308

309
    public function getForceEager(): ?bool
310
    {
311
        return $this->forceEager;
144✔
312
    }
313

314
    public function withForceEager(bool $forceEager): static
315
    {
316
        $self = clone $this;
3✔
317
        $self->forceEager = $forceEager;
3✔
318

319
        return $self;
3✔
320
    }
321

322
    public function getPaginationEnabled(): ?bool
323
    {
324
        return $this->paginationEnabled;
90✔
325
    }
326

327
    public function withPaginationEnabled(bool $paginationEnabled): static
328
    {
329
        $self = clone $this;
×
330
        $self->paginationEnabled = $paginationEnabled;
×
331

332
        return $self;
×
333
    }
334

335
    public function getPaginationType(): ?string
336
    {
337
        return $this->paginationType;
21✔
338
    }
339

340
    public function withPaginationType(string $paginationType): static
341
    {
342
        $self = clone $this;
×
343
        $self->paginationType = $paginationType;
×
344

345
        return $self;
×
346
    }
347

348
    public function getPaginationItemsPerPage(): ?int
349
    {
350
        return $this->paginationItemsPerPage;
72✔
351
    }
352

353
    public function withPaginationItemsPerPage(int $paginationItemsPerPage): static
354
    {
355
        $self = clone $this;
12✔
356
        $self->paginationItemsPerPage = $paginationItemsPerPage;
12✔
357

358
        return $self;
12✔
359
    }
360

361
    public function getPaginationMaximumItemsPerPage(): ?int
362
    {
363
        return $this->paginationMaximumItemsPerPage;
54✔
364
    }
365

366
    public function withPaginationMaximumItemsPerPage(int $paginationMaximumItemsPerPage): static
367
    {
368
        $self = clone $this;
×
369
        $self->paginationMaximumItemsPerPage = $paginationMaximumItemsPerPage;
×
370

371
        return $self;
×
372
    }
373

374
    public function getPaginationPartial(): ?bool
375
    {
376
        return $this->paginationPartial;
75✔
377
    }
378

379
    public function withPaginationPartial(bool $paginationPartial): static
380
    {
381
        $self = clone $this;
3✔
382
        $self->paginationPartial = $paginationPartial;
3✔
383

384
        return $self;
3✔
385
    }
386

387
    public function getPaginationClientEnabled(): ?bool
388
    {
389
        return $this->paginationClientEnabled;
81✔
390
    }
391

392
    public function withPaginationClientEnabled(bool $paginationClientEnabled): static
393
    {
394
        $self = clone $this;
12✔
395
        $self->paginationClientEnabled = $paginationClientEnabled;
12✔
396

397
        return $self;
12✔
398
    }
399

400
    public function getPaginationClientItemsPerPage(): ?bool
401
    {
402
        return $this->paginationClientItemsPerPage;
72✔
403
    }
404

405
    public function withPaginationClientItemsPerPage(bool $paginationClientItemsPerPage): static
406
    {
407
        $self = clone $this;
12✔
408
        $self->paginationClientItemsPerPage = $paginationClientItemsPerPage;
12✔
409

410
        return $self;
12✔
411
    }
412

413
    public function getPaginationClientPartial(): ?bool
414
    {
415
        return $this->paginationClientPartial;
75✔
416
    }
417

418
    public function withPaginationClientPartial(bool $paginationClientPartial): static
419
    {
420
        $self = clone $this;
12✔
421
        $self->paginationClientPartial = $paginationClientPartial;
12✔
422

423
        return $self;
12✔
424
    }
425

426
    public function getPaginationFetchJoinCollection(): ?bool
427
    {
428
        return $this->paginationFetchJoinCollection;
75✔
429
    }
430

431
    public function withPaginationFetchJoinCollection(bool $paginationFetchJoinCollection): static
432
    {
433
        $self = clone $this;
×
434
        $self->paginationFetchJoinCollection = $paginationFetchJoinCollection;
×
435

436
        return $self;
×
437
    }
438

439
    public function getPaginationUseOutputWalkers(): ?bool
440
    {
441
        return $this->paginationUseOutputWalkers;
75✔
442
    }
443

444
    public function withPaginationUseOutputWalkers(bool $paginationUseOutputWalkers): static
445
    {
446
        $self = clone $this;
×
447
        $self->paginationUseOutputWalkers = $paginationUseOutputWalkers;
×
448

449
        return $self;
×
450
    }
451

452
    public function getSecurity(): ?string
453
    {
454
        return $this->security;
114✔
455
    }
456

457
    public function withSecurity($security): static
458
    {
459
        $self = clone $this;
3✔
460
        $self->security = $security;
3✔
461

462
        return $self;
3✔
463
    }
464

465
    public function getSecurityMessage(): ?string
466
    {
467
        return $this->securityMessage;
114✔
468
    }
469

470
    public function withSecurityMessage(string $securityMessage): static
471
    {
472
        $self = clone $this;
×
473
        $self->securityMessage = $securityMessage;
×
474

475
        return $self;
×
476
    }
477

478
    public function getSecurityPostDenormalize(): ?string
479
    {
480
        return $this->securityPostDenormalize;
96✔
481
    }
482

483
    public function withSecurityPostDenormalize($securityPostDenormalize): static
484
    {
485
        $self = clone $this;
×
486
        $self->securityPostDenormalize = $securityPostDenormalize;
×
487

488
        return $self;
×
489
    }
490

491
    public function getSecurityPostDenormalizeMessage(): ?string
492
    {
493
        return $this->securityPostDenormalizeMessage;
96✔
494
    }
495

496
    public function withSecurityPostDenormalizeMessage(string $securityPostDenormalizeMessage): static
497
    {
498
        $self = clone $this;
×
499
        $self->securityPostDenormalizeMessage = $securityPostDenormalizeMessage;
×
500

501
        return $self;
×
502
    }
503

504
    public function getSecurityPostValidation(): ?string
505
    {
506
        return $this->securityPostValidation;
96✔
507
    }
508

509
    public function withSecurityPostValidation(string $securityPostValidation = null): static
510
    {
511
        $self = clone $this;
×
512
        $self->securityPostValidation = $securityPostValidation;
×
513

514
        return $self;
×
515
    }
516

517
    public function getSecurityPostValidationMessage(): ?string
518
    {
519
        return $this->securityPostValidationMessage;
96✔
520
    }
521

522
    public function withSecurityPostValidationMessage(string $securityPostValidationMessage = null): static
523
    {
524
        $self = clone $this;
×
525
        $self->securityPostValidationMessage = $securityPostValidationMessage;
×
526

527
        return $self;
×
528
    }
529

530
    public function getProcessor(): callable|string|null
531
    {
532
        return $this->processor;
96✔
533
    }
534

535
    public function withProcessor(callable|string|null $processor): static
536
    {
537
        $self = clone $this;
42✔
538
        $self->processor = $processor;
42✔
539

540
        return $self;
42✔
541
    }
542

543
    public function getProvider(): callable|string|null
544
    {
545
        return $this->provider;
132✔
546
    }
547

548
    public function withProvider(callable|string|null $provider): static
549
    {
550
        $self = clone $this;
39✔
551
        $self->provider = $provider;
39✔
552

553
        return $self;
39✔
554
    }
555

556
    public function getStateOptions(): ?OptionsInterface
557
    {
558
        return $this->stateOptions;
159✔
559
    }
560

561
    public function withStateOptions(?OptionsInterface $stateOptions): static
562
    {
563
        $self = clone $this;
3✔
564
        $self->stateOptions = $stateOptions;
3✔
565

566
        return $self;
3✔
567
    }
568

569
    public function getExtraProperties(): ?array
570
    {
571
        return $this->extraProperties;
80✔
572
    }
573

574
    public function withExtraProperties(array $extraProperties = []): static
575
    {
576
        $self = clone $this;
21✔
577
        $self->extraProperties = $extraProperties;
21✔
578

579
        return $self;
21✔
580
    }
581
}
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